main.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. // 毫秒计时器
  17. //extern uint32_t Timer_Ms;
  18. uint8_t mode = 0;
  19. static struct TIMER_Struct timer;
  20. int main(void)
  21. {
  22. // uint8_t memmem_flag = 0;
  23. Timer_Init();//定时器
  24. Usart1_Init();//打印串口
  25. Usart2_Init();//4G模块通信
  26. GPIOA_Init();//4G模块DTR IO口
  27. OLED_Init();
  28. OLED_Clear();
  29. OLED_ShowString(1, 1, "MS:");
  30. Log_Printf_Debug("1234\r\n");
  31. //注册设备,最多失败三次
  32. regist_device_sync();
  33. // Log_Printf_Debug("1234\r\n");
  34. // Log_Printf_Debug("regist_device_flag%d\r\n",regist_device_flag);
  35. // GPIO_SetBits(WAKE_GPIO, WAKE_GPIO_Pin);
  36. // bc260y.exit_sleep();
  37. // delay_ms(100);
  38. // bc260y.reset();
  39. // Log_Printf_Debug("123456\r\n");
  40. // bc260y.query_sleep_sync(&mode);
  41. // bc260y.query_sleep_sync(&mode);
  42. // bc260y.set_cfun_sync(1);//设置全功能模式
  43. // bc260y.set_cgreg_sync(2);//设置网络状态
  44. // bc260y.enter_sleep();
  45. // delay_ms(100);
  46. // bc260y.reset();
  47. // test_encaes128();
  48. while(1)
  49. {
  50. // 循环执行udp客户端OLED_ShowNum
  51. OLED_ShowNum(1, 4, time_get_delay(&timer), 6);
  52. // pump_business_loop_execution();
  53. }
  54. }