Skip to content

Commit 51ff9fc

Browse files
SuGliderCopilot
andauthored
fix(example): uses volatile for ISR variables
Co-authored-by: Copilot <[email protected]>
1 parent 5756b2d commit 51ff9fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/ESP32/examples/GPIO/FunctionalInterruptLambda/FunctionalInterruptLambda.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ volatile bool ledStateChanged = false; // Flag to indicate LED needs updating
7474

7575
// Variables to demonstrate lambda captures
7676
volatile uint32_t totalInterrupts = 0;
77-
unsigned long lastInterruptTime = 0;
77+
volatile unsigned long lastInterruptTime = 0;
7878

7979
// Debouncing variables (volatile for ISR safety)
8080
volatile unsigned long lastButton1InterruptTime = 0;

0 commit comments

Comments
 (0)