ATOMIC_BLOCK

ATOMIC_BLOCK(type)

Creates a block of code that is guaranteed to be executed atomically. Upon entering the block the Global Interrupt Status flag in SREG is disabled, and re-enabled upon exiting the block from any exit path.

Two possible macro parameters are permitted, ATOMIC_RESTORESTATE and ATOMIC_FORCEON.