Skip to content

Commit

Permalink
Update adc.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs authored May 14, 2024
1 parent eaf36ba commit cef94f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/adc/adc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ uint16_t getBatteryVoltage(void)
defined(ARDUINO_THINGPULSE_EPULSE_FEATHER)
// Here come the good guys...
return getVoltage();

#elif defined(ARDUINO_heltec_wifi_32_lora_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
// Enable ADC input switch, measure voltage and disable ADC input switch
uint16_t voltage;
Expand All @@ -94,6 +95,7 @@ uint16_t getBatteryVoltage(void)
voltage = getVoltage();
pinMode(ADC_CTRL, INPUT);
return voltage;

#elif defined(ARDUINO_ARCH_RP2040)
// Not implemented - no default VBAT input circuit (connect external divider to A0)
return 0;
Expand All @@ -102,9 +104,6 @@ uint16_t getBatteryVoltage(void)
// Not implemented - no default VBAT input circuit (connect external divider to A0)
return 0;

#elif defined(ARDUINO_heltec_wifi_32_lora_V3) || defined(ARDUINO_heltec_wifi_lora_32_V3)
return 0;

#elif defined(ARDUINO_M5STACK_Core2) || defined(ARDUINO_M5STACK_CORE2)
// battery monitoring chip
uint16_t voltage = M5.Power.getBatteryVoltage();
Expand Down

0 comments on commit cef94f9

Please sign in to comment.