summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-07-07 09:48:40 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-07-07 13:49:24 +0000
commite9ae1e9a8b5ad8e1bf21540bf6547d292df9ade5 (patch)
tree5b1935a9ba6b8a5003907583688485fa2e03282d
parent841e704fc3b5bde96ca8de4794c85198e2f12a65 (diff)
downloadrockbox-e9ae1e9a8b5ad8e1bf21540bf6547d292df9ade5.tar.gz
rockbox-e9ae1e9a8b5ad8e1bf21540bf6547d292df9ade5.zip
Fix red introduced in 841e704fc3
Change-Id: I5a924f77231a4764f3ad9b196875f5bf073945d6
-rw-r--r--firmware/powermgmt.c2
-rw-r--r--uisimulator/common/powermgmt-sim.c8
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;
103/* filtered battery voltage, millivolts */ 103/* filtered battery voltage, millivolts */
104static unsigned int battery_millivolts; 104static unsigned int battery_millivolts;
105#else 105#else
106#ifndef SIMULATOR
106int _battery_voltage(void) { return -1; } 107int _battery_voltage(void) { return -1; }
107const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11]; 108const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11];
108const unsigned short percent_to_volt_charge[11]; 109const unsigned short percent_to_volt_charge[11];
109#endif 110#endif
111#endif
110 112
111#if !(CONFIG_BATTERY_MEASURE & TIME_MEASURE) 113#if !(CONFIG_BATTERY_MEASURE & TIME_MEASURE)
112static int powermgmt_est_runningtime_min; 114static 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)
79#if CONFIG_CHARGING >= CHARGING_MONITOR 79#if CONFIG_CHARGING >= CHARGING_MONITOR
80 /* Keep external power until tick */ 80 /* Keep external power until tick */
81 ext_power_until_tick = current_tick + POWER_AFTER_CHARGE_TICKS; 81 ext_power_until_tick = current_tick + POWER_AFTER_CHARGE_TICKS;
82#elif CONFIG_CHARGING 82#elif CONFIG_CHARGING
83 /* Pretend the charger was disconnected */ 83 /* Pretend the charger was disconnected */
84 charger_input_state = CHARGER_UNPLUGGED; 84 charger_input_state = CHARGER_UNPLUGGED;
85#endif 85#endif
@@ -111,13 +111,17 @@ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
111const unsigned short percent_to_volt_charge[11] = 111const unsigned short percent_to_volt_charge[11] =
112{ 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300 }; 112{ 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300 };
113 113
114
115int _battery_voltage(void) 114int _battery_voltage(void)
116{ 115{
117 battery_status_update(); 116 battery_status_update();
118 return battery_millivolts; 117 return battery_millivolts;
119} 118}
120 119
120#if (CONFIG_BATTERY_MEASURE & TIME_MEASURE)
121static int powermgmt_est_runningtime_min;
122int _battery_time(void) { return powermgmt_est_runningtime_min; }
123#endif
124
121#if CONFIG_CHARGING 125#if CONFIG_CHARGING
122unsigned int power_input_status(void) 126unsigned int power_input_status(void)
123{ 127{