Returning from interrupt.

In a native avrc program I use the external interrupt 1 as a wake up source from powerdown mode. After setting up stuff and go to sleep I need only to do a task when an interrupt is fired or a reset is performed.

My code looks like the following:

Main:

setup stuff.
...
gotoSleep();

Interrupt:

do task;
...

As i want it to go to sleep mode again it's a good idea to modify the code in the main program like this instead of calling a sleep inside the int routine?

Main:

setup stuff.
...
gotoSleep();
while(1)
     gotoSleep();

The program counter register should be returned to the following instruction in the main program and execute forever the loop with the sleep request..

As I have seen I should also re-enable interrupts during an interrupt call cause the complier disables them automatically when executing an interrupt routine.. It looks to me that in a long time it will result in a stack overflow for too much int calls..

In this arduino set up you have two functions setup() and loop(), there is no main.

So a simple

void setup(){
// initilise stuff and attach interrupts
}

void loop(){
// do task
// sleep
}
void yourISR(){
// do stuff
}

should do you

Thank you! Great!