summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2006-11-11 01:18:57 +0000
committerBarry Wardell <rockbox@barrywardell.net>2006-11-11 01:18:57 +0000
commit8d2711b7d2d9f19dc2375bd9395359ed725375ab (patch)
tree788f6dc4e010f7cf6eac2e3a5d3eebe2427fe06e /apps
parentb3d2017057a47b1a5863d4e18e8d3eaf6a2fb63a (diff)
downloadrockbox-8d2711b7d2d9f19dc2375bd9395359ed725375ab.tar.gz
rockbox-8d2711b7d2d9f19dc2375bd9395359ed725375ab.zip
Improved power management (FS#3001). Shutdown rockbox when the battery gets to a level where the device doesn't function properly. Calculate remaining charging time while charging (rather than remaining running time). Show "Low Battery" and "Battery Empty" warnings. Also fixes FS#4786.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11507 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/deutsch.lang28
-rw-r--r--apps/lang/english.lang28
-rw-r--r--apps/misc.c28
3 files changed, 75 insertions, 9 deletions
diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang
index 41d3747b22..43bc6952e8 100644
--- a/apps/lang/deutsch.lang
+++ b/apps/lang/deutsch.lang
@@ -9782,3 +9782,31 @@
9782 *: "Keine Abspielliste" 9782 *: "Keine Abspielliste"
9783 </voice> 9783 </voice>
9784</phrase> 9784</phrase>
9785<phrase>
9786 id: LANG_WARNING_BATTERY_LOW
9787 desc: general warning
9788 user:
9789 <source>
9790 *: "WARNING! Low Battery!"
9791 </source>
9792 <dest>
9793 *: "WARNUNG! Batterie fast leer!"
9794 </dest>
9795 <voice>
9796 *: ""
9797 </voice>
9798</phrase>
9799<phrase>
9800 id: LANG_WARNING_BATTERY_EMPTY
9801 desc: general warning
9802 user:
9803 <source>
9804 *: "Battery empty! RECHARGE!"
9805 </source>
9806 <dest>
9807 *: "Batterie ist leer! AUFLADEN!"
9808 </dest>
9809 <voice>
9810 *: ""
9811 </voice>
9812</phrase>
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 0fce21ec08..9dd415901e 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -10196,3 +10196,31 @@
10196 *: "New file" 10196 *: "New file"
10197 </voice> 10197 </voice>
10198</phrase> 10198</phrase>
10199<phrase>
10200 id: LANG_WARNING_BATTERY_LOW
10201 desc: general warning
10202 user:
10203 <source>
10204 *: "WARNING! Low Battery!"
10205 </source>
10206 <dest>
10207 *: "WARNING! Low Battery!"
10208 </dest>
10209 <voice>
10210 *: ""
10211 </voice>
10212</phrase>
10213<phrase>
10214 id: LANG_WARNING_BATTERY_EMPTY
10215 desc: general warning
10216 user:
10217 <source>
10218 *: "Battery empty! RECHARGE!"
10219 </source>
10220 <dest>
10221 *: "Battery empty! RECHARGE!"
10222 </dest>
10223 <voice>
10224 *: ""
10225 </voice>
10226</phrase>
diff --git a/apps/misc.c b/apps/misc.c
index 7e4e5071a1..80c4588f0f 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -583,16 +583,25 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
583#ifdef X5_BACKLIGHT_SHUTDOWN 583#ifdef X5_BACKLIGHT_SHUTDOWN
584 x5_backlight_shutdown(); 584 x5_backlight_shutdown();
585#endif 585#endif
586 if (!battery_level_safe())
587 gui_syncsplash(3*HZ, true, "%s %s",
588 str(LANG_WARNING_BATTERY_EMPTY),
589 str(LANG_SHUTTINGDOWN));
590 else if (battery_level_critical())
591 gui_syncsplash(3*HZ, true, "%s %s",
592 str(LANG_WARNING_BATTERY_LOW),
593 str(LANG_SHUTTINGDOWN));
594 else {
586#ifdef HAVE_TAGCACHE 595#ifdef HAVE_TAGCACHE
587 if (!tagcache_prepare_shutdown()) 596 if (!tagcache_prepare_shutdown())
588 { 597 {
589 cancel_shutdown(); 598 cancel_shutdown();
590 gui_syncsplash(HZ, true, str(LANG_TAGCACHE_BUSY)); 599 gui_syncsplash(HZ, true, str(LANG_TAGCACHE_BUSY));
591 return false; 600 return false;
592 } 601 }
593#endif 602#endif
594 603 gui_syncsplash(0, true, str(LANG_SHUTTINGDOWN));
595 gui_syncsplash(0, true, str(LANG_SHUTTINGDOWN)); 604 }
596 605
597 if (global_settings.fade_on_stop 606 if (global_settings.fade_on_stop
598 && (audio_status() & AUDIO_STATUS_PLAY)) 607 && (audio_status() & AUDIO_STATUS_PLAY))
@@ -607,7 +616,8 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
607 if (callback != NULL) 616 if (callback != NULL)
608 callback(parameter); 617 callback(parameter);
609 618
610 system_flush(); 619 if (!battery_level_critical()) /* do not save on critical battery */
620 system_flush();
611#ifdef HAVE_EEPROM_SETTINGS 621#ifdef HAVE_EEPROM_SETTINGS
612 if (firmware_settings.initialized) 622 if (firmware_settings.initialized)
613 { 623 {