From da5910eac0629c4ac38c7967160e455ae6db9915 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Fri, 29 Jun 2007 19:01:24 +0000 Subject: Shutdown and powermanagement cleanup: * Use the proper function for determining whether the battery level is safe, and get rid of the extra one. Low battery warning now appears at 10% or less. * Don't delay shutdown artificially by 3 seconds due to low/critical battery warning. * Shutdown at critical battery level: Skip all disk-hitting housekeeping, make sure dircache stops, and don't mark disk as clean in eeprom. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13734 a1c6a512-1295-4272-9138-f99709370657 --- firmware/powermgmt.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'firmware/powermgmt.c') diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 000a8bb2ec..26323c43ab 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -143,11 +143,6 @@ bool battery_level_safe(void) return battery_level() >= 10; } -bool battery_level_critical(void) -{ - return false; -} - void set_poweroff_timeout(int timeout) { (void)timeout; @@ -422,12 +417,6 @@ bool battery_level_safe(void) return battery_centivolts > battery_level_dangerous[battery_type]; } -/* Tells if the battery is in critical powersaving state */ -bool battery_level_critical(void) -{ - return ((battery_capacity * battery_percent / BATTERY_CAPACITY_MIN) < 10); -} - void set_poweroff_timeout(int timeout) { poweroff_timeout = timeout; @@ -1291,7 +1280,7 @@ void shutdown_hw(void) } #endif audio_stop(); - if (!battery_level_critical()) { /* do not save on critical battery */ + if (battery_level_safe()) { /* do not save on critical battery */ #ifdef HAVE_LCD_BITMAP glyph_cache_save(); #endif -- cgit v1.2.3