From 93b03cf7c6f98c97160d326bb85a944266c3f4f2 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Mon, 23 Dec 2024 11:15:25 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E7=94=B5=E5=8E=8Bruntime?= =?utf8?q?=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/application/battery/service/battery_driver.cpp | 6 +++++- code/sdk/drivers/peripheral/utils/custom_save_runtime.h | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/battery/service/battery_driver.cpp b/code/sdk/application/battery/service/battery_driver.cpp index 80e0ff35a..969a8d3be 100644 --- a/code/sdk/application/battery/service/battery_driver.cpp +++ b/code/sdk/application/battery/service/battery_driver.cpp @@ -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) { diff --git a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h index 5dad22bb3..ee9dfcc14 100644 --- a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h @@ -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; -- 2.17.1