When entering into an interrupt, you normally want to exit the interrupt & return to the same place in the program from where the interrupt came in, but I have a need to jump out of my main program loop, say when a switch is pressed - is this even do-able, will it cause problems, will my PIC spontaneously combust?
An example...
Main program is looping
A switch is pressed
the program jumps to an IOC interrupt routine
the interrupt routine 'points' the program to run from another location & exits?
sorry for the n00b line of questioning...I've never had to tackle this problem perviously.
(I'm aware that the elegant way of doing this is to set a variable/flag within the interrupt, then the main program picks up the flag & acts upon it ...but there may be delay between returning out the interrupt & the main loop picking up that the flag has been set - in this short elapsed time worlds may have collided)
Bookmarks