1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jens Arnold 2007-08-17 06:45:18 +00:00
parent 12706e4b1d
commit 0fac492c3d
46 changed files with 948 additions and 289 deletions

View file

@ -167,13 +167,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);