summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorNick Peskett <rockbox@peskett.co.uk>2012-01-05 22:25:13 +0000
committerNick Peskett <rockbox@peskett.co.uk>2012-01-05 22:25:13 +0000
commit7b376865337913cf618fb112af52ac1c5a44074f (patch)
treef7074426479b6b796e0541f4cec13177e589d65e /uisimulator
parent1a26524d016c4184a46c118b965889312c1f93c5 (diff)
downloadrockbox-7b376865337913cf618fb112af52ac1c5a44074f.tar.gz
rockbox-7b376865337913cf618fb112af52ac1c5a44074f.tar.bz2
rockbox-7b376865337913cf618fb112af52ac1c5a44074f.zip
Fix charger emulation in the simulator.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31586 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/powermgmt-sim.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/uisimulator/common/powermgmt-sim.c b/uisimulator/common/powermgmt-sim.c
index 7500b3dd7b..4445185bb9 100644
--- a/uisimulator/common/powermgmt-sim.c
+++ b/uisimulator/common/powermgmt-sim.c
@@ -31,8 +31,6 @@
#define BATT_MAXRUNTIME (10 * 60) /* maximum runtime with full battery in
minutes */
-extern void send_battery_level_event(void);
-extern int last_sent_battery_level;
extern int battery_percent;
static bool charging = false;
@@ -50,18 +48,20 @@ static void battery_status_update(void)
/* change the values: */
if (charging) {
if (battery_millivolts >= BATT_MAXMVOLT) {
+#if CONFIG_CHARGING
/* Pretend the charger was disconnected */
+ charger_input_state = CHARGER_UNPLUGGED;
+#endif
charging = false;
- queue_broadcast(SYS_CHARGER_DISCONNECTED, 0);
- last_sent_battery_level = 100;
}
}
else {
if (battery_millivolts <= BATT_MINMVOLT) {
+#if CONFIG_CHARGING
/* Pretend the charger was connected */
+ charger_input_state = CHARGER_PLUGGED;
+#endif
charging = true;
- queue_broadcast(SYS_CHARGER_CONNECTED, 0);
- last_sent_battery_level = 0;
}
}
@@ -96,7 +96,7 @@ int _battery_voltage(void)
#if CONFIG_CHARGING
unsigned int power_input_status(void)
{
- return charging ? POWER_INPUT_NONE : POWER_INPUT_MAIN;
+ return charging ? POWER_INPUT_CHARGER : POWER_INPUT_NONE;
}
bool charging_state(void)