View Single Post
Old 06-09-2009, 11:15 AM   #1652 (permalink)
JayC
EcoModding Lurker
 
Join Date: Jul 2008
Location: Memphis, TN
Posts: 58

2010 Prius - '10 Toyota Prius IV
Last 3: 51.4 mpg (US)
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Originally Posted by MPaulHolmes View Post
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
  Reply With Quote