Skip to content

Commit 98694ab

Browse files
TAMCTecP-R-O-C-H-Y
andauthored
fix rebooting while reading charge state (espressif#7307)
Co-authored-by: Jan Procházka <[email protected]>
1 parent f00371c commit 98694ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

variants/tamc_termod_s3/variant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ float getBatteryCapacity() {
1515
}
1616

1717
bool getChargingState() {
18-
pinMode(CHG, INPUT_PULLUP);
1918
return !digitalRead(CHG);
2019
}
2120

@@ -33,6 +32,7 @@ void ARDUINO_ISR_ATTR chargeIsr() {
3332
}
3433

3534
extern "C" void initVariant(void){
35+
pinMode(CHG, INPUT_PULLUP);
3636
attachInterrupt(CHG, chargeIsr, CHANGE);
3737
analogReadResolution(12);
3838
}

0 commit comments

Comments
 (0)