From 1d1a17c0dbd0fdf2857c5d1636713247d28f1762 Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Tue, 16 Oct 2007 10:48:16 +0000 Subject: Improved H10 ADC driver. We now do things exactly as the OF does. This includes shifting the readings by 0x14 when PLL is enabled. Battery voltages and remote/scrollpad values adjusted accordingly. We also now wait for the ADC to indicate the conversion is complete before reading the data, so hopefully we will get more reliably steady readings. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15141 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/iriver/h10/powermgmt-h10.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'firmware/target/arm/iriver/h10/powermgmt-h10.c') diff --git a/firmware/target/arm/iriver/h10/powermgmt-h10.c b/firmware/target/arm/iriver/h10/powermgmt-h10.c index 18e3879c43..6f8cd12276 100644 --- a/firmware/target/arm/iriver/h10/powermgmt-h10.c +++ b/firmware/target/arm/iriver/h10/powermgmt-h10.c @@ -25,18 +25,18 @@ const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = { #ifdef IRIVER_H10 - 3760 + 3733 #elif defined IRIVER_H10_5GB - 3720 + 3695 #endif }; const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = { #ifdef IRIVER_H10 - 3650 + 3627 #elif defined IRIVER_H10_5GB - 3650 + 3627 #endif }; @@ -44,9 +44,9 @@ const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = { #ifdef IRIVER_H10 - { 3760, 3800, 3850, 3870, 3900, 3950, 4020, 4070, 4110, 4180, 4240 } + { 3733, 3772, 3821, 3840, 3869, 3917, 3985, 4034, 4072, 4140, 4198 } #elif defined IRIVER_H10_5GB - { 3720, 3740, 3800, 3820, 3840, 3880, 3940, 4020, 4060, 4150, 4240 } + { 3695, 3714, 3772, 3791, 3811, 3850, 3908, 3985, 4024, 4111, 4198 } #endif }; @@ -54,14 +54,14 @@ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = const unsigned short percent_to_volt_charge[11] = { #ifdef IRIVER_H10 - 3990, 4030, 4060, 4080, 4100, 4120, 4150, 4180, 4220, 4260, 4310 + 3956, 3995, 4024, 4043, 4063, 4082, 4111, 4140, 4179, 4218, 4266 #elif defined IRIVER_H10_5GB /* TODO: Not yet calibrated */ - 3880, 3920, 3960, 4000, 4060, 4100, 4150, 4190, 4240, 4280, 4330 + 3850, 3888, 3927, 3966, 4024, 4063, 4111, 4150, 4198, 4237, 4286 #endif }; -#define BATTERY_SCALE_FACTOR 4800 +#define BATTERY_SCALE_FACTOR 4650 /* full-scale ADC readout (2^10) in millivolt */ /* Returns battery voltage from ADC [millivolts] */ -- cgit v1.2.3