To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 538
537  |  539
Subject: 
Aborting from ISR
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Sun, 14 Jul 2002 16:14:12 GMT
Viewed: 
2198 times
  
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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR