[riot-notifications] [RIOT-OS/RIOT] cpu/atmega_common: RTT and RTC support (#8842)
notifications at github.com
Wed Apr 17 20:49:01 CEST 2019
Volatile is actually pretty simple: the compiler may not optimize away volatile memory operations, and may not reorder volatile operations with respect to other volatile operations.
In this case, volatile is being used to prevent the compiler from reordering operations that access the state structs with respect to operations that change the timer interrupt mask. This allows for writing interrupt safe code without globally disabling interrupts. If volatile is removed then the code would no longer be interrupt safe as written. I have added a comment to clarify this.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications