summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-01-25 12:02:54 -0500
committerMichael Sevakis <jethead71@rockbox.org>2012-01-25 12:02:54 -0500
commit7ccd2c9d16743820369a5e61e6b41919c4978407 (patch)
tree80924b366a9c811a5aa40a4881492b8a397232b3 /uisimulator
parent0499aff9d040c73191d1be670ed3512410841a8c (diff)
downloadrockbox-7ccd2c9d16743820369a5e61e6b41919c4978407.tar.gz
rockbox-7ccd2c9d16743820369a5e61e6b41919c4978407.tar.bz2
rockbox-7ccd2c9d16743820369a5e61e6b41919c4978407.zip
Fix power_input_status in sim where target has a battery switch.
Change-Id: Ic00410a5b143d71928dc67c47d94d317b8ecadcd
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/powermgmt-sim.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/uisimulator/common/powermgmt-sim.c b/uisimulator/common/powermgmt-sim.c
index 41732c94a2..3430b1ea79 100644
--- a/uisimulator/common/powermgmt-sim.c
+++ b/uisimulator/common/powermgmt-sim.c
@@ -121,8 +121,14 @@ int _battery_voltage(void)
#if CONFIG_CHARGING
unsigned int power_input_status(void)
{
- return charger_input_state >= CHARGER_PLUGGED
+ unsigned int status = charger_input_state >= CHARGER_PLUGGED
? POWER_INPUT_CHARGER : POWER_INPUT_NONE;
+
+#ifdef HAVE_BATTERY_SWITCH
+ status |= POWER_INPUT_BATTERY;
+#endif
+
+ return status;
}
bool charging_state(void)