diff options
Diffstat (limited to 'bootloader/main.c')
-rw-r--r-- | bootloader/main.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bootloader/main.c b/bootloader/main.c index d78b4adc69..afaef69f45 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -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); |