Skip to content

Commit 26720b8

Browse files
authored
Update volatile.adoc
1 parent 1684ec6 commit 26720b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Language/Variables/Variable Scope & Qualifiers/volatile.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ void blink()
8585
[source,arduino]
8686
----
8787
#include <util/atomic.h> // this library includes the ATOMIC_BLOCK macro.
88-
88+
volatile int input_from_interrupt
8989
9090
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
9191
// code with interrupts blocked (consecutive atomic operations will not get interrupted)
92+
int result = input_from_interrupt;
9293
}
9394
9495
----

0 commit comments

Comments
 (0)