Report battery state in mV

This commit is contained in:
Lynn Ochs 2021-07-16 21:21:22 +02:00
parent 51a95e7ffb
commit aa653aecea

2
adc.c
View File

@ -20,7 +20,7 @@ void adc_setup(void) {
uint32_t adc_bat_voltage(void) {
if (adc_get_flag(ADC1, ADC_SR_EOC)) {
bat_voltage_mv = adc_read_regular(ADC1);
bat_voltage_mv = adc_read_regular(ADC1) * 3300 / 2048;
}
return bat_voltage_mv;
}