Skip to content

Commit c38aff7

Browse files
authored
Add interrupt for external charge detection (#9332)
Tested on Thinknode m4, m6, and T1000-e
1 parent ff50ba4 commit c38aff7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Power.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,16 @@ bool Power::setup()
723723
runASAP = true;
724724
},
725725
CHANGE);
726+
#endif
727+
#ifdef EXT_CHRG_DETECT
728+
attachInterrupt(
729+
EXT_CHRG_DETECT,
730+
[]() {
731+
power->setIntervalFromNow(0);
732+
runASAP = true;
733+
BaseType_t higherWake = 0;
734+
},
735+
CHANGE);
726736
#endif
727737
enabled = found;
728738
low_voltage_counter = 0;

0 commit comments

Comments
 (0)