From e9ae1e9a8b5ad8e1bf21540bf6547d292df9ade5 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 7 Jul 2021 09:48:40 -0400 Subject: [PATCH] Fix red introduced in 841e704fc3 Change-Id: I5a924f77231a4764f3ad9b196875f5bf073945d6 --- firmware/powermgmt.c | 2 ++ uisimulator/common/powermgmt-sim.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 51ea99f6fa..7e1523eb57 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -103,10 +103,12 @@ static unsigned int avgbat; /* filtered battery voltage, millivolts */ static unsigned int battery_millivolts; #else +#ifndef SIMULATOR int _battery_voltage(void) { return -1; } const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11]; const unsigned short percent_to_volt_charge[11]; #endif +#endif #if !(CONFIG_BATTERY_MEASURE & TIME_MEASURE) static int powermgmt_est_runningtime_min; diff --git a/uisimulator/common/powermgmt-sim.c b/uisimulator/common/powermgmt-sim.c index 3430b1ea79..511648bc9d 100644 --- a/uisimulator/common/powermgmt-sim.c +++ b/uisimulator/common/powermgmt-sim.c @@ -79,7 +79,7 @@ static void battery_status_update(void) #if CONFIG_CHARGING >= CHARGING_MONITOR /* Keep external power until tick */ ext_power_until_tick = current_tick + POWER_AFTER_CHARGE_TICKS; -#elif CONFIG_CHARGING +#elif CONFIG_CHARGING /* Pretend the charger was disconnected */ charger_input_state = CHARGER_UNPLUGGED; #endif @@ -111,13 +111,17 @@ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = const unsigned short percent_to_volt_charge[11] = { 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300 }; - int _battery_voltage(void) { battery_status_update(); return battery_millivolts; } +#if (CONFIG_BATTERY_MEASURE & TIME_MEASURE) +static int powermgmt_est_runningtime_min; +int _battery_time(void) { return powermgmt_est_runningtime_min; } +#endif + #if CONFIG_CHARGING unsigned int power_input_status(void) {