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 / 543
542  |  544
Subject: 
Re: Aborting from ISR
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Mon, 15 Jul 2002 18:47:43 GMT
Viewed: 
2392 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.

To remove your program from the UserISR just set 'UserISR to ['] NoOp -
or even better: to the previously stored old value.

My questions were a bit ambiguous. I don't want to abort the routine
running on the ISR; I want (from the ISR routine) to abort a currently running
user routine - eg abort something started from the console. So, for example,
if a program goes into an infinite loop, it can be aborted with a button press.

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
Yes, you just have to read the current value of 'UserISR.
If no other program is hooked to the ISR this is the same as the
execution address of NoOp.

Here, I want to find out if the forth interpreter is just sitting
waiting for input (ie is in the idle loop) or is actually running a program,
so that an ISR routine triggered by a button press can do different things
in the two situations.

Cheers,
Richard



Message has 2 Replies:
  Re: Aborting from ISR
 
(...) I see. Tired of re-booting hey? :o)) There's no way already available that I know of. I think that Mr. Hempel is looking into this. Maybe if we play with the return stack... (...) The way Forth works is that it is running the program. If you (...) (22 years ago, 15-Jul-02, to lugnet.robotics.rcx.pbforth)
  Re: Aborting from ISR
 
Ah I see... intriguing idea :) Rereading your original post it should have been quite clear what you wanted. Unfortunately (as far as I know) Mario is right, there doesn't seem to be a clean solution other than manipulating the return stack. I've (...) (22 years ago, 16-Jul-02, to lugnet.robotics.rcx.pbforth)

Message is in Reply To:
  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)

10 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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