What is the best way to implement "thread-safe" access of global variables in an ISR?
I have a few global variables are are accessed both in the ISR and in main functions. If the ISR fires when a variable is accessed in the main code, I may get unpredictable results.