Conceptual
Login

volatile Keyword in C

volatile tells the compiler a variable can change outside normal program flow, in an ISR or a hardware register, so every access must actually read or write memory instead of being cached or optimized away. Omitting it on ISR-shared variables produces loops that never see the update.