Quote:
Originally Posted by MPaulHolmes
How do I pop the stack in C??? It's wonderful that the status register gets pushed onto the stack when I call cli(); (at least I think it does), but how do I retrieve it without assembly? stack.pop()?
|
No, it's all done for you if you use the "Signal" for you ISR. But after looking at your code, and the reason you are clearing the Interrupt bit, disregard my comment. You are protecting that section of code from being interrupted and "tricky" that you are reseting the SREG I bit when you restore it afterwards
Whether or not the compiler is doing that with register variables or not is of not concern right now ... don't let me distract you
Jay