Created
December 26, 2018 21:25
-
-
Save kmcallister/526035afc10bef35512537c10efd876e to your computer and use it in GitHub Desktop.
ATOMIC_BLOCK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <util/atomic.h> | |
| void blahblah(); | |
| void foo() { | |
| ATOMIC_BLOCK(ATOMIC_FORCEON) { | |
| blahblah(); | |
| } | |
| } | |
| // avr-gcc -c foo.c -std=c99 -Os && avr-objdump -dr foo.o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Disassembly of section .text: | |
| 00000000 <foo>: | |
| 0: f8 94 cli | |
| 2: 00 d0 rcall .+0 ; 0x4 <foo+0x4> | |
| 2: R_AVR_13_PCREL blahblah | |
| 4: 78 94 sei | |
| 6: 08 95 ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment