| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "stm32f10x.h"
- #include "Timer.h"
- #include "OLED.h"
- #include "GPIOA.h"
- #include "Usart1.h"
- #include "Usart2.h"
- #include "Regist.h"
- #include "PumpBusiness.h"
- #include "CONFIG.h"
- #include "mbedtls_util.h"
- #include "Timer_Module.h"
- #include "Log_Module.h"
- #include "Tuoreniot.h"
- #include "bc260y.h"
- #include "At_Module.h"
- // 计时器
- static struct TIMER_Struct timer;
- //static uint8_t send_flag = 1;
- //static char AT_CMD[512];
- int main(void)
- {
- // uint8_t memmem_flag = 0;
- Timer_Init();//定时器
- Usart1_Init();//打印串口
- Usart2_Init();//4G模块通信
- GPIOA_Init();//4G模块DTR IO口
-
- OLED_Init();
- OLED_Clear();
- OLED_ShowString(1, 1, "MS:");
-
- Log_Printf_Debug("1234\r\n");
- // my_delay_ms(5000);
-
- //注册设备,最多失败三次
-
- regist_device_sync();
-
- Log_Printf_Debug("注册结束\r\n");
-
- while(1)
- {
- // 循环执行udp客户端OLED_ShowNum
- OLED_ShowNum(1, 4, time_get_delay(&timer), 6);
-
- if(time_get_delay(&timer) > 60 * 1000)
- {
-
-
- time_clear(&timer);
- }
-
-
- // if(send_flag == 1)
- // {
- // uint8_t connectID = 1;
- // uint16_t data_length = 6;
- // uint8_t data[10] = {0x03, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38};
- // uint8_t rai = 2;
- //
- //
- // memset(AT_CMD, 0, sizeof(AT_CMD));
- // sprintf(AT_CMD + strlen(AT_CMD), "AT+QISEND=%d,%d,\"", connectID, data_length); // 拼接AT指令
- // for(uint16_t i = 0; i < data_length; i++)
- // {
- // sprintf(AT_CMD + strlen(AT_CMD), "%02X", data[i]);
- // }
- // sprintf(AT_CMD + strlen(AT_CMD), "\",%d\r\n", rai); // 拼接AT指令
- //
- //
- //
- // Log_Printf_Debug("\r\n");
- // Log_Printf_Debug(AT_CMD);
- // Log_Printf_Debug("\r\n");
- //
- // send_flag = 0;
- // }
- //
- // AT_Handle();
-
- pump_business_loop_execution();
-
-
-
- }
-
- }
|