tags:

views:

50

answers:

1

Is it safe to use extern data qualifier for a variable in an ISR?

+1  A: 

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

Mark E
Keep in mind you might some kind of locking/atomic operations when accessing such a variable if it's on a multi processor machine, or the variable are accessed in multiple ISRs
nos
@nos: Could you please elaborate your comment?
wrapperm