summaryrefslogtreecommitdiffstats
path: root/bootloader/iriver_h300.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-08-17 06:45:18 +0000
committerJens Arnold <amiconn@rockbox.org>2007-08-17 06:45:18 +0000
commit0fac492c3da8b46ad1cf5a668e5d851c63443a94 (patch)
tree95fb6637601a4b3c730f4aec1d2e7e7ab78e208b /bootloader/iriver_h300.c
parent12706e4b1d4ce65df441dcf6e2b160657ea3fa38 (diff)
downloadrockbox-0fac492c3da8b46ad1cf5a668e5d851c63443a94.tar.gz
rockbox-0fac492c3da8b46ad1cf5a668e5d851c63443a94.tar.bz2
rockbox-0fac492c3da8b46ad1cf5a668e5d851c63443a94.zip
First step of powermanagement rework: * Move target specific stuff into target tree, starting with battery voltage tables and voltage reading. (This revealed some incorrect percent_to_voltage_charging mappings). * Voltage reading on 1st gen ipods is now correct. * Clean up obsolete config #defines.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14375 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader/iriver_h300.c')
-rw-r--r--bootloader/iriver_h300.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/bootloader/iriver_h300.c b/bootloader/iriver_h300.c
index 32950a58dc..dab3693050 100644
--- a/bootloader/iriver_h300.c
+++ b/bootloader/iriver_h300.c
@@ -109,13 +109,11 @@ void shutdown(void)
/* Print the battery voltage (and a warning message). */
void check_battery(void)
{
- int adc_battery, battery_voltage, batt_int, batt_frac;
+ int battery_voltage, batt_int, batt_frac;
- adc_battery = adc_read(ADC_BATTERY);
-
- battery_voltage = (adc_battery * BATTERY_SCALE_FACTOR) / 10000;
- batt_int = battery_voltage / 100;
- batt_frac = battery_voltage % 100;
+ battery_voltage = battery_adc_voltage();
+ batt_int = battery_voltage / 1000;
+ batt_frac = (battery_voltage % 1000) / 10;
printf("Batt: %d.%02dV", batt_int, batt_frac);