Extern variable in ISR
Is it safe to use exte开发者_JAVA技巧rn data qualifier for a variable in an ISR?
Assuming C: yes, but you need to mark the variable wth keyword volatile to let the compiler know its value can change in more than one thread (the interrupt is basically a different thread).
精彩评论