From 9e89f6865618d0b48b4676baad4ef693f69129d1 Mon Sep 17 00:00:00 2001
From: chen <15335560115@163.com>
Date: 星期四, 09 一月 2025 14:19:35 +0800
Subject: [PATCH] GPS成功热启动,1-3s接受到有效数据,jlink问题

---
 keil/include/drivers/serial_at_cmd_app.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/keil/include/drivers/serial_at_cmd_app.c b/keil/include/drivers/serial_at_cmd_app.c
index aedfaa2..0223e9b 100644
--- a/keil/include/drivers/serial_at_cmd_app.c
+++ b/keil/include/drivers/serial_at_cmd_app.c
@@ -17,6 +17,7 @@
 #define Label_id_local    1     //标签id
 #define data_buff_MAX     50    //基站数量
 #define Lora_TXD_bff_MAX  220   //发送缓存区大小  >4+8+4*基站数量+2=14+4*基站数量
+#define FIRST_MIN_OPEN_TIME 30
 
 uint8_t mUsartReceivePack[100] = {0};
 uint8_t mUsart2ReceivePack[150] = {0};
@@ -143,7 +144,7 @@
 		uint32_t datalenth_gga,gga_num;
 		uint32_t u32GGaLenth;
 		char GGA_Format_message[200];
-extern uint8_t bat_percent,userkey_state;
+extern uint8_t bat_percent,userkey_state,gps_first_flag;
 void UsartParseDataHandler(uint8_t data)
 {
     if(state5V_prase_flag&&!g_com_map[MODBUS_MODE])
@@ -275,12 +276,15 @@
 								if(pos_state!=0)
 								{
 									
-                gps_timeout_flag=0;//不超时接收状态
-                gps_need_data_flag=0;//接收数据完成
-                gps_wait_count=0;//清0接收状态
+                
 								//gps_power_state=0;//关闭gps
 								if(gps_open_flag){
+								//if(gps_open_flag&&!gps_first_flag){
 									
+//								delay_ms(1000);
+								gps_timeout_flag=0;//不超时接收状态
+                gps_need_data_flag=0;//接收数据完成
+                gps_wait_count=0;//清0接收状态
 								UDPClient_UploadGPS();//上传GPS超时无效数据
 								gps_power_state=0;//立即关掉gps,防止串口数据过多导致无法切换休眠
 								update_led_power_state();

--
Gitblit v1.9.3