Atomic Operations | Cypress Semiconductor
Hello. I have two lines of code, one is to read a variable and the other is to reset it to zero. The problem is that the variable is only updated by interrupt, and I do not want to have an interrupt between these two lines. However, I do not want to miss an interrupt also, so disabling interrupts does not work for me. I figured out it should be done via atomic operations, but I couldn’t figured how or find an example.
Could you guide me to do it, please.