main.c 963 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #include <string.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include "stm32f10x.h"
  5. #include "Timer.h"
  6. #include "OLED.h"
  7. #include "GPIOA.h"
  8. #include "Usart1.h"
  9. #include "Usart2.h"
  10. #include "Regist.h"
  11. #include "PumpBusiness.h"
  12. #include "CONFIG.h"
  13. #include "mbedtls_util.h"
  14. #include "Timer_Module.h"
  15. #include "Log_Module.h"
  16. #include "Tuoreniot.h"
  17. // 计时器
  18. static struct TIMER_Struct timer;
  19. int main(void)
  20. {
  21. // uint8_t memmem_flag = 0;
  22. Timer_Init();//定时器
  23. Usart1_Init();//打印串口
  24. Usart2_Init();//4G模块通信
  25. GPIOA_Init();//4G模块DTR IO口
  26. OLED_Init();
  27. OLED_Clear();
  28. OLED_ShowString(1, 1, "MS:");
  29. Log_Printf_Debug("1234\r\n");
  30. //注册设备,最多失败三次
  31. regist_device_sync();
  32. Log_Printf_Debug("注册结束\r\n");
  33. while(1)
  34. {
  35. // 循环执行udp客户端OLED_ShowNum
  36. OLED_ShowNum(1, 4, time_get_delay(&timer), 6);
  37. if(time_get_delay(&timer) > 60 * 1000)
  38. {
  39. time_clear(&timer);
  40. }
  41. pump_business_loop_execution();
  42. }
  43. }