|
Hi,
Is there any way of ABORTing the current program from the ISR ? I
want to attach a routine to 'UserISR and have it ABORT and then execute
POWER_OFF when the off/on button is pressed.
I would also like to know whether a user program or the idle loop
is running, so that the code could do different things depending on whether
it was powered down while idling or while executing a program (obviously, the
program could set a flag, but I would like this to be general). Does pbForth
supply any way of getting this info ?
Cheers,
Richard
|
|
Message has 2 Replies: | | Re: Aborting from ISR
|
| (...) To remove your program from the UserISR just set 'UserISR to ['] NoOp - or even better: to the previously stored old value. (...) Yes, you just have to read the current value of 'UserISR. If no other program is hooked to the ISR this is the (...) (22 years ago, 14-Jul-02, to lugnet.robotics.rcx.pbforth)
| | | Re: Aborting from ISR
|
| It works! (after countless crashes and firmwire reloads that is ... :) By modifying the saved Instruction Pointer to point to a memory area which in turn contains the address of an "abort word", on the next execution of a word (either inside a (...) (22 years ago, 16-Jul-02, to lugnet.robotics.rcx.pbforth)
|
10 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|