优化电压runtime存储 1557/1
authorpenglei <1624952103@qq.com>
Mon, 23 Dec 2024 03:15:25 +0000 (11:15 +0800)
committerpenglei <1624952103@qq.com>
Mon, 23 Dec 2024 03:15:25 +0000 (11:15 +0800)
code/sdk/application/battery/service/battery_driver.cpp
code/sdk/drivers/peripheral/utils/custom_save_runtime.h

index 80e0ff3..969a8d3 100644 (file)
@@ -629,7 +629,11 @@ static bool adc_get_sample_result(float *voltage, uint8_t channel)
         // PRINT("*voltage : %.3f \n",*voltage);
         // PRINT("DecimalPart_1 : %d , DecimalPart_2 : %d DecimalPart_3 : %d \n",DecimalPart_1,DecimalPart_2,DecimalPart_3);
         uint16_t value = DecimalPart_1 << 8 | DecimalPart_2 << 4 | DecimalPart_3 << 0;
-        uapi_save_runtime_log(RUNTIME_LOG_BAT_VOL | value);
+
+        if(IntPart == 4)
+            uapi_save_runtime_log(RUNTIME_LOG_BAT_VOL_HIGH | value);
+        else
+            uapi_save_runtime_log(RUNTIME_LOG_BAT_VOL_LOW | value);
         // PRINT("RUNTIME_LOG_BAT_VOL | value : %x \n",RUNTIME_LOG_BAT_VOL | value);
         if(percernt_installized)
         {
index 5dad22b..ee9dfcc 100644 (file)
@@ -2,7 +2,7 @@
  *@Author:luozheng 1732036298@qq.com
  *@Date:2024-12-18 10:27:52
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-12-21 19:40:03
+ * @LastEditTime: 2024-12-23 11:08:01
  *@FilePath:/FD230/code/sdk/drivers/peripheral/utils/custom_save_runtime.h
  */
 /**
@@ -223,7 +223,8 @@ extern "C"
     RUNTIME_LOG_VOTE_ID =0x1300,
 
     //电压变化
-    RUNTIME_LOG_BAT_VOL =0xf000,
+    RUNTIME_LOG_BAT_VOL_LOW = 0xE000, //3V
+    RUNTIME_LOG_BAT_VOL_HIGH =0xf000, //4V
 
   } runtime_log_cmd_Id;