From 414dad42c59f43919489f45236d57e1b345b8a65 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 15 May 2010 15:03:16 +0000 Subject: 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 --- apps/misc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/misc.c b/apps/misc.c index 3dfc2892ca..07b4c947a2 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -264,7 +264,11 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter) scrobbler_poweroff(); #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) +#if CONFIG_CHARGING >= CHARGING_MONITOR + if(!charging_state()) +#else if(!charger_inserted()) +#endif #endif { bool batt_safe = battery_level_safe(); @@ -406,7 +410,11 @@ bool list_stop_handler(void) if (TIME_BEFORE(current_tick, last_off + HZ/2)) { - if (charger_inserted()) +#if CONFIG_CHARGING >= CHARGING_MONITOR + if (charging_state()) +#else + if (charger_inserted()) +#endif { charging_splash(); ret = true; /* screen is dirty, caller needs to refresh */ -- cgit v1.2.3