summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/iriver/h10
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 /firmware/target/arm/iriver/h10
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 'firmware/target/arm/iriver/h10')
-rwxr-xr-xfirmware/target/arm/iriver/h10/adc-h10.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/target/arm/iriver/h10/adc-h10.c b/firmware/target/arm/iriver/h10/adc-h10.c
index cf937851b9..8a4e24dd64 100755
--- a/firmware/target/arm/iriver/h10/adc-h10.c
+++ b/firmware/target/arm/iriver/h10/adc-h10.c
@@ -88,5 +88,11 @@ void adc_init(void)
adc_scan(ADC_REMOTE);
adc_scan(ADC_SCROLLPAD);
+ /* FIXME: The ADC sometimes reads 0 for the battery
+ voltage for the first few seconds. It would be better to fix this by
+ figuring out how to use the ADC properly. Until then, work around the
+ problem by waiting until it reads a proper value*/
+ while(adc_scan(ADC_UNREG_POWER)==0);
+
tick_add_task(adc_tick);
}