From 8d2711b7d2d9f19dc2375bd9395359ed725375ab Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Sat, 11 Nov 2006 01:18:57 +0000 Subject: 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 --- firmware/target/arm/iriver/h10/adc-h10.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'firmware/target/arm') 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); } -- cgit