diff options
author | Nick Peskett <rockbox@peskett.co.uk> | 2012-01-05 22:25:13 +0000 |
---|---|---|
committer | Nick Peskett <rockbox@peskett.co.uk> | 2012-01-05 22:25:13 +0000 |
commit | 7b376865337913cf618fb112af52ac1c5a44074f (patch) | |
tree | f7074426479b6b796e0541f4cec13177e589d65e /uisimulator | |
parent | 1a26524d016c4184a46c118b965889312c1f93c5 (diff) | |
download | rockbox-7b376865337913cf618fb112af52ac1c5a44074f.tar.gz 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.c | 14 |
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 @@ | |||
31 | #define BATT_MAXRUNTIME (10 * 60) /* maximum runtime with full battery in | 31 | #define BATT_MAXRUNTIME (10 * 60) /* maximum runtime with full battery in |
32 | minutes */ | 32 | minutes */ |
33 | 33 | ||
34 | extern void send_battery_level_event(void); | ||
35 | extern int last_sent_battery_level; | ||
36 | extern int battery_percent; | 34 | extern int battery_percent; |
37 | static bool charging = false; | 35 | static bool charging = false; |
38 | 36 | ||
@@ -50,18 +48,20 @@ static void battery_status_update(void) | |||
50 | /* change the values: */ | 48 | /* change the values: */ |
51 | if (charging) { | 49 | if (charging) { |
52 | if (battery_millivolts >= BATT_MAXMVOLT) { | 50 | if (battery_millivolts >= BATT_MAXMVOLT) { |
51 | #if CONFIG_CHARGING | ||
53 | /* Pretend the charger was disconnected */ | 52 | /* Pretend the charger was disconnected */ |
53 | charger_input_state = CHARGER_UNPLUGGED; | ||
54 | #endif | ||
54 | charging = false; | 55 | charging = false; |
55 | queue_broadcast(SYS_CHARGER_DISCONNECTED, 0); | ||
56 | last_sent_battery_level = 100; | ||
57 | } | 56 | } |
58 | } | 57 | } |
59 | else { | 58 | else { |
60 | if (battery_millivolts <= BATT_MINMVOLT) { | 59 | if (battery_millivolts <= BATT_MINMVOLT) { |
60 | #if CONFIG_CHARGING | ||
61 | /* Pretend the charger was connected */ | 61 | /* Pretend the charger was connected */ |
62 | charger_input_state = CHARGER_PLUGGED; | ||
63 | #endif | ||
62 | charging = true; | 64 | charging = true; |
63 | queue_broadcast(SYS_CHARGER_CONNECTED, 0); | ||
64 | last_sent_battery_level = 0; | ||
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
@@ -96,7 +96,7 @@ int _battery_voltage(void) | |||
96 | #if CONFIG_CHARGING | 96 | #if CONFIG_CHARGING |
97 | unsigned int power_input_status(void) | 97 | unsigned int power_input_status(void) |
98 | { | 98 | { |
99 | return charging ? POWER_INPUT_NONE : POWER_INPUT_MAIN; | 99 | return charging ? POWER_INPUT_CHARGER : POWER_INPUT_NONE; |
100 | } | 100 | } |
101 | 101 | ||
102 | bool charging_state(void) | 102 | bool charging_state(void) |