Skip to content

Tags

#rtos

Posts tagged #rtos on Dynamo Geeks: 1 post from the community, most useful first.

1 post

Posts tagged #rtos

  1. Article

    volatile is not a mutex: sharing data between an ISR and your main loop

    Every few months a junior in my team come with the same bug: a counter updated in an interrupt, read in the main loop, and sometimes the value is garbage. And the first answer is always "but I put volatile". So here is the explanation I give them, maybe is useful for someone else. What volatile does volatile tells the compiler: this variable can change outside of the normal program flow, so read it from memory every…

    Diego Ramírez3likes3comments