main.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #include <string.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include "stm32f10x.h"
  5. #include "Timer.h"
  6. #include "GPIOA.h"
  7. #include "sys.h"
  8. #include "Usart1.h"
  9. #include "Usart2.h"
  10. #include "Regist.h"
  11. #include "PumpBusiness.h"
  12. #include "AT.h"
  13. #include "bc260.h"
  14. #include "sys.h"
  15. #include "CONFIG.h"
  16. // 毫秒计时器
  17. //extern uint32_t Timer_Ms;
  18. uint8_t mode = 0;
  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. // uint8_t restult1[13] = "\0\0\0\0\0\0RDY\0\0\0\0";
  27. // uint8_t rdytest[5]="RDY";
  28. // memmem_flag=memmem(restult1,13,rdytest,4);
  29. Log_Printf_Debug("1234\r\n");
  30. //注册设备,最多失败三次
  31. regist_device();
  32. Log_Printf_Debug("1234\r\n");
  33. // Log_Printf_Debug("regist_device_flag%d\r\n",regist_device_flag);
  34. // GPIO_SetBits(WAKE_GPIO, WAKE_GPIO_Pin);
  35. // bc260y.exit_sleep();
  36. // delay_ms(100);
  37. // bc260y.reset();
  38. // Log_Printf_Debug("123456\r\n");
  39. // bc260y.query_sleep_sync(&mode);
  40. // bc260y.query_sleep_sync(&mode);
  41. // bc260y.set_cfun_sync(1);//设置全功能模式
  42. // bc260y.set_cgreg_sync(2);//设置网络状态
  43. // bc260y.enter_sleep();
  44. // delay_ms(100);
  45. // bc260y.reset();
  46. while(1)
  47. {
  48. //AT_Handle();
  49. // 循环执行udp客户端
  50. pump_business_loop_execution();
  51. }
  52. }