This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Modify the return from interrupt

Hello !

I have an interrupt like this :
void int_timer_0 (void) interrupt 1
{
... instructions ...
if ( condition ) {
// power down
}
... instructions ...
}

In the interrupt, i want to execute an C function 'power_down' (this function power down the product with an infinite loop ). But the interrupt (timer 0) must be call on the next timer overflows because it is used to transmit the power down information.
So, i want to put in the stack the address of the function to call and make a return from interrupt. I want to insert a code like this :
#pragma asm
push ??? ; power_down address (high)
push ??? ; power_down address (low)

reti
#pragma endasm
but i don't know the syntax for the address of 'C' fucntion.

Thanks

Benoit.

0