I am using PIC18F452 microcontroller. I wrote program, which basically looks like this:
void interrupt()
{
A-time counting...
if(Blackout==1){asm sleep; asm nop;}
B-some other commands
}
void main{....}
There A and B are command lines. So, i am using Timer1 module, which owerflows every 0,25seconds. Then program counter goes to interrupt routine. Here time counting routines are executed (A commands). Next program checks if mains voltage is present. If voltage is present, B commands are executed. After this main() routine is executed. But if blackout is occured, system goes to sleep after A line execution. After 0,25sec timer1 gives interrupt, microcontroller is waked-up.
So my question is: after wake-up interrupt routine will be executed from the begining (A command line) or B line will be executed?
void interrupt()
{
A-time counting...
if(Blackout==1){asm sleep; asm nop;}
B-some other commands
}
void main{....}
There A and B are command lines. So, i am using Timer1 module, which owerflows every 0,25seconds. Then program counter goes to interrupt routine. Here time counting routines are executed (A commands). Next program checks if mains voltage is present. If voltage is present, B commands are executed. After this main() routine is executed. But if blackout is occured, system goes to sleep after A line execution. After 0,25sec timer1 gives interrupt, microcontroller is waked-up.
So my question is: after wake-up interrupt routine will be executed from the begining (A command line) or B line will be executed?