My project has a stop button which invokes an interrupt sub-routine (turn off all the outputs, bleep a buzzer twice).
At the end of that sub-routine I know that I have to put a RETURN command but the problem is that I want the program to return to the first line not the next line due to be executed.
Obviously a GOTO (the first line) before RETURN can do what I want but then the interrupt cannot be reset (even if the the first line of the program is SETINT....).
I can't use a hardware interrupt as the Picaxe is an 18M2, plus I've already committed to a PCB.
I have thought that the interrupt routine could set a flag and that the flag could be checked with an IF..THEN..GOTO between every program line but that doesn't seem very elegant even though I have enough memory to do it.
What am I missing here?
Any ideas very welcome fellow forum members !!
At the end of that sub-routine I know that I have to put a RETURN command but the problem is that I want the program to return to the first line not the next line due to be executed.
Obviously a GOTO (the first line) before RETURN can do what I want but then the interrupt cannot be reset (even if the the first line of the program is SETINT....).
I can't use a hardware interrupt as the Picaxe is an 18M2, plus I've already committed to a PCB.
I have thought that the interrupt routine could set a flag and that the flag could be checked with an IF..THEN..GOTO between every program line but that doesn't seem very elegant even though I have enough memory to do it.
What am I missing here?
Any ideas very welcome fellow forum members !!