main.c 673 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "main.h"
  2. #include "bsp_time.h"
  3. #include "selfcheck.h"
  4. #include "hal_ble_client.h"
  5. #include "hal_ble_host.h"
  6. #include "nrf_delay.h"
  7. #include "hal_dfu.h"
  8. extern void PRE_Init(void);
  9. extern void USR_Init(void);
  10. extern void USR_Process(void);
  11. int main(void)
  12. {
  13. //初始化抽象层、系统层
  14. // {
  15. #if BLE_DFU_ENANBLE
  16. hal_dfu_init();// Initialize the async SVCI interface to bootloader before any interrupts are enabled.
  17. #endif
  18. PRE_Init();
  19. #if BLE_DFU_ENANBLE
  20. hal_dfu_server_init();
  21. #endif
  22. if(selfcheck_Init() == SELFCHECK_FLOW_DONE)
  23. // }
  24. {
  25. USR_Init(); //初始化驱动层、功能层、业务逻辑层、应用层
  26. }
  27. while (1)
  28. {
  29. USR_Process(); //系统调度器
  30. }
  31. }