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
    Aborting from ISR —Richard Lucock
   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 (...) (22 years ago, 14-Jul-02, to lugnet.robotics.rcx.pbforth)
   
        Re: Aborting from ISR —Alexander Cech
     (...) 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 —Alexander Cech
      (...) This should be : IsISRFree? 'UserISR ['] NoOp = ; of course. (22 years ago, 14-Jul-02, to lugnet.robotics.rcx.pbforth)
    
         Re: Aborting from ISR —Richard Lucock
     Hi, (...) 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 (...) (22 years ago, 15-Jul-02, to lugnet.robotics.rcx.pbforth)
    
         Re: Aborting from ISR —Mario Beaulieu
      (...) 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 —Alexander Cech
     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)
   
        Re: Aborting from ISR —Alexander Cech
   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)
   
        RE: Aborting from ISR —Ralph Hempel
     (...) Alex, I'll have a good look at this and then post an article. I have a funny feeling you're doing it the hard way, but that's because I know the insides of the patient better than you do - I am Dr Frankenforth after all! Oh, and sorry for the (...) (22 years ago, 17-Jul-02, to lugnet.robotics.rcx.pbforth)
   
        Re: Aborting from ISR —Richard Lucock
   Hi, (...) Yup, that does what I want, although I can't remember enough about forth internals to work out why it works. But it does seem to depend on the return stack having a particular structure, so I do wonder - what happens if the interrupt (...) (22 years ago, 20-Jul-02, to lugnet.robotics.rcx.pbforth)
   
        Re: Aborting from ISR —Alexander Cech
   (...) Hi, the nice thing in this solution is that it doesn't inspect or touch the user return stack at all. The structures that are used to get to the FIP (instruction pointer) - namely: the position of the saved D-stack in the *private* R-stack and (...) (22 years ago, 20-Jul-02, to lugnet.robotics.rcx.pbforth)
 

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