#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;
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);