I'm experimenting with multitasking on the Arduino. I've looked around a lot and I decided I want to experiment a bit with interrupts. I'd like to switch between a few contexts based on a timer which generates interrupts.
The common way to handle interrupts with the Arduino sdk is: attachInterrupt(interrupt, function, mode) When function exits, the 'normal' context - the loop() - continues executing.
I wonder if I can determine the context at the moment the interrupt happens: The instruction pointer and stack, etc. That way, I could store that information and resume it at another time, much like the Arduino sdk already does when the interrupt function exits.
Thanks in advance!