watch_adc: enable ADC when checking battery; let's get rid of this footgun once and for all

This commit is contained in:
Joey Castillo
2025-05-21 08:51:39 -04:00
parent 07a085e90b
commit 310ad3d095
10 changed files with 10 additions and 17 deletions

View File

@@ -51,9 +51,7 @@ void _watch_init(void) {
while(!SUPC->STATUS.bit.VREGRDY); // wait for voltage regulator to become ready
// check the battery voltage...
watch_enable_adc();
uint16_t battery_voltage = watch_get_vcc_voltage();
watch_disable_adc();
// ...because we can enable the more efficient low power regulator if the system voltage is > 2.5V
// still, enable LPEFF only if the battery voltage is comfortably above this threshold.
if (battery_voltage >= 2700) {