开发者

Extern variable in ISR

开发者 https://www.devze.com 2022-12-14 07:53 出处:网络
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

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号