Firmware · Interrupts
An interrupt can run in the middle of your main code, so data both of them touch is at risk of being corrupted.