Blog11.7K views3,171 votes0 replies4,572 following
volatile in Embedded C: What It Guarantees for Memory-Mapped Registers
volatile stops the compiler from optimizing away register accesses, but it does not make them atomic or ordered. Here is how to use it safely and what to verify.