main.c 883 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "usart.h"
  2. #include "led.h"
  3. #include "delay.h"
  4. #include <stdio.h>
  5. #include "sys_data.h"
  6. #include "timer.h"
  7. #include "bat.h"
  8. #include "iwdg.h"
  9. int main(void)
  10. {
  11. // LED硬件初始化
  12. // LED_GPIO_Config();
  13. // 12V电源初始化
  14. // BAT_12V_Config();
  15. // 5V电源初始化
  16. // BAT_5V_Config();
  17. // USART3初始化
  18. USART3_config();
  19. // 测试串口
  20. // USART_485_config();
  21. // 定时器初始化
  22. timer_config();
  23. IWDG_Configuration(5000);// 参数单位ms
  24. while(1)
  25. {
  26. if(usartMsg.done == 1)
  27. {
  28. broad_to_host();
  29. delay_ms(1000);
  30. }
  31. IWDG_feed();
  32. }
  33. }
  34. void assert_failed(uint8_t* file, uint32_t line)
  35. {
  36. /* User can add his own implementation to report the file name and line number,
  37. ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  38. /* Infinite loop */
  39. // while (1)
  40. //{}
  41. // printf("Wrong parameters value: file %s on line %d\r\n", __FILE__, __LINE__);
  42. }