From 9e4b512b9f9bb83d62a2a52e96cae7f216492ba7 Mon Sep 17 00:00:00 2001 From: 1624952103 Date: Thu, 14 May 2026 09:52:51 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E5=85=85=E7=94=B5ic=E5=8F=82?= =?utf8?q?=E6=95=B0=E8=AE=BE=E7=BD=AEDPM=20=E4=BC=98=E5=8C=96=E6=BB=A1?= =?utf8?q?=E7=94=B5=E5=88=A4=E6=96=AD(=E8=A1=A5=E5=85=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/zhihui/services/battery/service/battery_driver.cpp | 4 ++-- 1 file changed, 2 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 ef6fd3810..30b4f61c4 100644 --- a/code/sdk/zhihui/services/battery/service/battery_driver.cpp +++ b/code/sdk/zhihui/services/battery/service/battery_driver.cpp @@ -768,7 +768,7 @@ static uint8_t battery_get_power_percentage(void) #ifdef ENABLE_HP4570 -static bool hp4570_check_charge_done(float voltage, uint8_t *percent) +static bool hp4570_check_charge_done(float voltage, int *percent) { static float s_hp4570_chg_done_last_v = -1.0f; static uint8_t s_hp4570_chg_done_flat_cnt = 0; @@ -802,7 +802,7 @@ static bool hp4570_check_charge_done(float voltage, uint8_t *percent) if (s_hp4570_chg_done_flat_cnt >= HP4570_CHG_DONE_FLAT_STREAK && history_percent < 100) { history_percent++; - *io_percent = history_percent; + *percent = history_percent; printf("[电池计算] HP4570 CHG_DONE+>=%.1fV 连续电压不升 cnt=%u(>=%u) -> 累加 %% hist=%d\n", HP4570_CHG_DONE_MIN_VOLTAGE_V, (unsigned int)s_hp4570_chg_done_flat_cnt, (unsigned int)HP4570_CHG_DONE_FLAT_STREAK, history_percent); -- 2.17.1