From 1ebb1f507bf7e2b95782bff74ffc5d48e9b5394b Mon Sep 17 00:00:00 2001
From: chen <15335560115@163.com>
Date: 星期四, 26 九月 2024 11:49:09 +0800
Subject: [PATCH] 车载V1.5版本,增加滤波算法和上传数据修改,延长更新现存列表时间,解决无法对所有通信设备全部校准offset的bug

---
 APL/APL.c |   90 ++++++++++++++++++++++----------------------
 1 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/APL/APL.c b/APL/APL.c
index fc052b8..d092127 100644
--- a/APL/APL.c
+++ b/APL/APL.c
@@ -233,52 +233,52 @@
 void PowerLedTask(void)
 { 
      static u8 powerled_state=0;
-    if(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin))
-    {
-        chongman_time=0;
-        only_one_flag=0;
-        if(!power_state&&!chargedbg_flag)
-        {
-            CloseRTK4G();  
-            DBG_SetMode(DBG_MODE_CHARGE);
-            power_state = 1;
-        }
-       while(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)&&DBG_GetMode() == DBG_MODE_CHARGE)
-	 {
-        if(HIDO_TimerGetTick()-adctick>6000)  //6s采样一次 电量
-        {   
-            adctick = HIDO_TimerGetTick();
-            chongman_time=chongman_time+6;
-            #ifdef BATTARY_DEBUG
-                //printf("电压: %f V,电量 %d,标志位%d,时间 %d\r\n",fVoltage1,bat_percent2,only_one_flag,chongman_time);
-            #endif
-            if( HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_10))
-            {
-                bat_percent2=Power_GetBatteryPercentage();
+//    if(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin))
+//    {
+//        chongman_time=0;
+//        only_one_flag=0;
+//        if(!power_state&&!chargedbg_flag)
+//        {
+//            CloseRTK4G();  
+//            DBG_SetMode(DBG_MODE_CHARGE);
+//            power_state = 1;
+//        }
+//       while(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)&&DBG_GetMode() == DBG_MODE_CHARGE)
+//	 {
+//        if(HIDO_TimerGetTick()-adctick>6000)  //6s采样一次 电量
+//        {   
+//            adctick = HIDO_TimerGetTick();
+//            chongman_time=chongman_time+6;
+//            #ifdef BATTARY_DEBUG
+//                //printf("电压: %f V,电量 %d,标志位%d,时间 %d\r\n",fVoltage1,bat_percent2,only_one_flag,chongman_time);
+//            #endif
+//            if( HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_10))
+//            {
+//                bat_percent2=Power_GetBatteryPercentage();
 
-            }else{
-                HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_SET);
-                bat_percent2=Power_GetBatteryPercentage();
-                HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET);
-            }
-        }
-        if(fVoltage1>=4.15&&!only_one_flag)
-        {
-        only_one_flag=1;
-        chongman_time=0;
-        }
-        if(fVoltage1>=4.15&&chongman_time>=1800)
-            {
-                powerled = GREEN;
-            }else{
-                powerled = RED;
-            }
-         delay_ms(100);
-        DBG_Poll();
-        Internet_Poll();
-        Set4LEDColor(0,0,0,powerled);
-     }
-    }
+//            }else{
+//                HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_SET);
+//                bat_percent2=Power_GetBatteryPercentage();
+//                HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET);
+//            }
+//        }
+//        if(fVoltage1>=4.15&&!only_one_flag)
+//        {
+//        only_one_flag=1;
+//        chongman_time=0;
+//        }
+//        if(fVoltage1>=4.15&&chongman_time>=1800)
+//            {
+//                powerled = GREEN;
+//            }else{
+//                powerled = RED;
+//            }
+//         delay_ms(100);
+//        DBG_Poll();
+//        Internet_Poll();
+//        Set4LEDColor(0,0,0,powerled);
+//     }
+//    }
 
             chargeon = 0;
            if(power_state)

--
Gitblit v1.9.3