From 087a29da3eb95d2cc149535498b10e06e39bc7db Mon Sep 17 00:00:00 2001 From: 1624952103 Date: Mon, 9 Feb 2026 10:01:27 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E4=BD=8E=E7=94=B5=E7=94=B5?= =?utf8?q?=E5=8E=8B=E8=B7=B3=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../zhihui/services/battery/service/battery_driver.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/sdk/zhihui/services/battery/service/battery_driver.cpp b/code/sdk/zhihui/services/battery/service/battery_driver.cpp index 7081bf72a..88c350aa2 100644 --- a/code/sdk/zhihui/services/battery/service/battery_driver.cpp +++ b/code/sdk/zhihui/services/battery/service/battery_driver.cpp @@ -565,8 +565,12 @@ void battery_restore_vol(void) batteryservice_get_voltage_by_channel(&cur_vol,ADC_CHANNEL_BAT_VOLTAGE); - if(bat_vol.percent > 0 && bat_vol.percent<=100 && (fabsf(cur_vol - bat_vol.avg_vol) < 0.25)) - history_percent = bat_vol.percent; + if (bat_vol.percent > 0 && bat_vol.percent <= 100) { + float threshold = get_charge_stat() ? 0.4f : 0.25f; + if (fabsf(cur_vol - bat_vol.avg_vol) < threshold) { + history_percent = bat_vol.percent; + } + } // for(int i = 0; i < AVG_VOLTAGE_COUNT;i++) // { // printf("history_data[%d]:%.3f\n",i,bat_vol.history_data[i]); -- 2.17.1