I'm working with Arduino's libraries. And my interest in the possibility to change the call stack of the SPI interrupt, this because I want: after the interrupt happen, the program could jump to other function and not to the interrupted address.
I mean: This is the Main code.
void loop ()
{
func();
}
void func()
{
// code
// here happens the ISR interrupt
}
ISR happens inside func()
ISR(SPI_STC_vect)
{
// code
// SPDR = 0x00; // MY ANSWER to SPI
// MODIFY CALL STACK TO GO TO LOOP()
}
Now, after answering the SPI, I want to go back to loop()
instead of continue func()
.
How can I do this?
Thanks for your help.