From f94a5365f1400b6234cda1f2925dba2a50110c71 Mon Sep 17 00:00:00 2001
From: chen <15335560115@163.com>
Date: 星期四, 05 十二月 2024 14:17:16 +0800
Subject: [PATCH] 安邦车载手环V1.13,修改4G发送时间和GPS刷新时间单位为s可配置

---
 keil/include/src/gps.c |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/keil/include/src/gps.c b/keil/include/src/gps.c
index 9121dd0..8c2ed1e 100644
--- a/keil/include/src/gps.c
+++ b/keil/include/src/gps.c
@@ -1,13 +1,15 @@
 #include "board.h"
-#define GPS_OPEN_TIME_OUT  240
-#define GPS_RESTART_TIME1  1200
-#define GPS_RESTART_TIME2  120
+#include "global_param.h"
+#define GPS_OPEN_TIME_OUT  120		//超时2分钟开启
+#define GPS_RESTART_TIME1  600  //10分钟
+#define GPS_RESTART_TIME2  48		//1分钟
 
 extern uint16_t gps_wait_count;
+extern uint8_t power_low_flag;
 uint8_t gps_power_state,gps_uwb_flag,gps_4g_flag,gps_timeout_flag,gps_need_data_flag = 1;
 void GPS_Poll(void)
-{
-
+{if(!power_low_flag)
+		{
     if(gps_4g_flag||gps_uwb_flag) {
         gps_power_state = 1;  //打开GPS电源
         if(!gps_timeout_flag) {
@@ -21,7 +23,7 @@
             } else {
                 gps_wait_count++;
                 gps_power_state=0;//关闭GPS
-                if(gps_wait_count>GPS_RESTART_TIME2) {
+                if(gps_wait_count>g_com_map[GPS_REFRESH_WAIT_COUNT]) {//改为s
                     gps_power_state=1;//开启GPS
                     gps_need_data_flag=1;
                     gps_wait_count=0;
@@ -46,12 +48,20 @@
             }
 
         }
-    } else {
-        gps_power_state=0;//关闭gps
-        gps_wait_count=0;
-        gps_timeout_flag=0;
-        gps_need_data_flag=1;
-    }
+			} else {
+					gps_power_state=0;//关闭gps
+					gps_wait_count=0;
+					gps_timeout_flag=0;
+					gps_need_data_flag=1;
+			}
+	}else{
+		gps_power_state=0;//关闭GPS
+		update_led_power_state();
+		//初始化GPS计数数据
+		gps_need_data_flag=1;
+		gps_wait_count=0;
+		gps_timeout_flag=0;
+		}
 }
 void GpsConrol(uint8_t flag_4g_uwb,uint8_t open_close)
 {

--
Gitblit v1.9.3