main.c 696 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "ac780x.h"
  2. #include "timer.h"
  3. #include "gpio.h"
  4. #include "cfg.h"
  5. #include "IAP.h"
  6. #include "process.h"
  7. #include "main_task.h"
  8. #include "watchdog.h"
  9. /*!
  10. * @brief entry
  11. *
  12. * @param[in] none
  13. * @return none
  14. */
  15. int main(void)
  16. {
  17. #ifndef IS_BOOTLOADER
  18. __ASM("CPSIE I");///使能全局中断
  19. SCB->VTOR = APP1_ADDRESS; ///<重映射向量表
  20. #endif
  21. InitDelay();
  22. InitDebug();
  23. Config_Init();
  24. Watchdog_Init();
  25. #ifdef IS_BOOTLOADER
  26. Start_BootLoader();
  27. #endif
  28. GPIO_PortInit();
  29. IAP_Init();
  30. Process_Init();
  31. TIMER_PrdInit();
  32. Task_Init();
  33. printf("AirControlBox booted \r\n");
  34. while (1)
  35. {
  36. Watchdog_Feed();
  37. Task_Handle();
  38. }
  39. }