cancel
Showing results for 
Search instead for 
Did you mean: 

Bit Variables ISR Safe?

paulrbryson
Associate III
Posted on April 24, 2015 at 20:43

I am using the Cosmic compiler and I want to read and write bit variables in an ISR.  I am wondering if there is a guarantee that ALL bit variable manipulations are atomic (ie using bitwise instructions).  

If not - since multiple bit variables are stored within a single byte I would have to bracket every access of every bit variable with interrupt masking. 
2 REPLIES 2
luca239955_stm1_st
Senior II
Posted on April 27, 2015 at 16:46

Hello,

what you ask is guaranteed for bit global variables.

Regards,

Luca (Cosmic)

paulrbryson
Associate III
Posted on April 27, 2015 at 23:30

Thank you.  Bit variables will save me a lot of memory.