main.c 705 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "app_conf.h"
  2. #include "core_cmFunc.h"
  3. #include "dev_conf.h"
  4. #include "hal_can.h"
  5. #include "hal_conf.h"
  6. #include "misc.h"
  7. #define APP_FLASH_OFFSET 0x8000
  8. #define BOOT_EN 1
  9. int main(void)
  10. {
  11. #if (BOOT_EN == 1)
  12. NVIC_SetVectorTable(NVIC_VectTab_FLASH, APP_FLASH_OFFSET);
  13. __set_PRIMASK(0);
  14. #endif
  15. NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
  16. hal_systick_init();
  17. hal_gpio_init();
  18. // can_queue_init();
  19. dev_can_network_init();
  20. usart_config_init(&usart1_context, 115200);
  21. hal_i2c1_init();
  22. dev_key_button_init();
  23. set_firmver();
  24. iap_flag_release();
  25. iap_param_init();
  26. while (1)
  27. {
  28. app_task_schdule();
  29. }
  30. return 0;
  31. }