开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜