diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-05-15 15:03:16 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-05-15 15:03:16 +0000 |
commit | 414dad42c59f43919489f45236d57e1b345b8a65 (patch) | |
tree | 1b29c055a2a8a646fca4412b2167ae39347dfc19 /apps | |
parent | e34c0593e7d859270695af08b2efc8b1e42e4473 (diff) | |
download | rockbox-414dad42c59f43919489f45236d57e1b345b8a65.tar.gz rockbox-414dad42c59f43919489f45236d57e1b345b8a65.zip |
If HAVE_POWEROFF_WHILE_CHARGING is not defined and the charging configuration specifies CHARGING_MONITOR or greater, allow poweroff while plugged but not actually charging the battery.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26055 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/misc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/misc.c b/apps/misc.c index 3dfc2892ca..07b4c947a2 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -264,8 +264,12 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter) | |||
264 | scrobbler_poweroff(); | 264 | scrobbler_poweroff(); |
265 | 265 | ||
266 | #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) | 266 | #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) |
267 | #if CONFIG_CHARGING >= CHARGING_MONITOR | ||
268 | if(!charging_state()) | ||
269 | #else | ||
267 | if(!charger_inserted()) | 270 | if(!charger_inserted()) |
268 | #endif | 271 | #endif |
272 | #endif | ||
269 | { | 273 | { |
270 | bool batt_safe = battery_level_safe(); | 274 | bool batt_safe = battery_level_safe(); |
271 | int audio_stat = audio_status(); | 275 | int audio_stat = audio_status(); |
@@ -406,7 +410,11 @@ bool list_stop_handler(void) | |||
406 | 410 | ||
407 | if (TIME_BEFORE(current_tick, last_off + HZ/2)) | 411 | if (TIME_BEFORE(current_tick, last_off + HZ/2)) |
408 | { | 412 | { |
409 | if (charger_inserted()) | 413 | #if CONFIG_CHARGING >= CHARGING_MONITOR |
414 | if (charging_state()) | ||
415 | #else | ||
416 | if (charger_inserted()) | ||
417 | #endif | ||
410 | { | 418 | { |
411 | charging_splash(); | 419 | charging_splash(); |
412 | ret = true; /* screen is dirty, caller needs to refresh */ | 420 | ret = true; /* screen is dirty, caller needs to refresh */ |