Skip to main content
paulrbryson
Associate III
Apr 24, 2015 6:43 PM UTC
Question

Bit Variables ISR Safe?

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. 
    This topic has been closed for replies.

    2 replies

    luca239955_stm1_st
    Associate
    Apr 27, 2015 2:46 PM UTC
    Posted on April 27, 2015 at 16:46

    Hello,

    what you ask is guaranteed for bit global variables.

    Regards,

    Luca (Cosmic)

    paulrbryson
    Associate III
    Apr 27, 2015 9:30 PM UTC
    Posted on April 27, 2015 at 23:30

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