
#include "app_conf.h"
// #include "core_cmFunc.h"
#include "ble_core.h"
#include "dev_conf.h"
#include "hal_can.h"
#include "hal_conf.h"
#include "hal_pwm.h"
#include "misc.h"

#define APP_FLASH_OFFSET 0x8000
#define BOOT_EN          1

int main(void)
{
#if (BOOT_EN == 1)
    NVIC_SetVectorTable(NVIC_VectTab_FLASH, APP_FLASH_OFFSET);
    __set_PRIMASK(0);
#endif

    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
    hal_systick_init();
    hal_gpio_init();
    pwm_init(&pwm_timer3_content);
    pwm_mode(&pwm_timer3_content, 1);
    dev_can_network_init();
    usart_config_init(&usart1_context, 115200);
    usart_config_init(&usart2_context, 9600);
    ble_init();
    hal_i2c1_init();
    dev_key_button_init();

    set_firmver();
    iap_flag_release();
    iap_param_init();

    while (1)
    {
        app_task_schdule();
    }

    return 0;
}
