View Single Post
Old 06-07-2009, 11:30 PM   #1617 (permalink)
MPaulHolmes
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
SREG = cSREG;

is when they get turned back on again. cSREG is an unsigned byte, so when I do the following when the interrupts are enabled:

cSREG = SREG;

The state of all the status registers is saved.

And when I do:

SREG = cSREG;
The status register gets put back just how it was before doing cli(); This re-enables the interrupts.
__________________
kits and boards
  Reply With Quote