Skip to content

Commit 5756b2d

Browse files
SuGliderCopilot
andauthored
fix(example): uses volatile for ISR variables
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a096360 commit 5756b2d

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
@@ -73,7 +73,7 @@ volatile bool ledState = false;
7373
volatile bool ledStateChanged = false; // Flag to indicate LED needs updating
7474

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

7979
// Debouncing variables (volatile for ISR safety)

0 commit comments

Comments
 (0)