To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 1773
1772  |  1774
Subject: 
Re: librcx & interrupt handler
Newsgroups: 
lugnet.robotics.rcx
Date: 
Thu, 29 Aug 2002 09:30:17 GMT
Viewed: 
2389 times
  
hi,

I have another question about interrupt handlers. I would like to know how
(if it is possible) I could call the ROM OCIA handler. The reason is that I
would like to execute a small task periodicaly but if I simply redirect the
OCIA handler (VECTOR_OCIA = my_function()), the ROM OCIA handler is not
called (that's the point of redirection :-). So I thought that if I called
the ROM handler from my_function(), something like this:

void my_function() {
  do_my_stuff();
  call_the_ROM_handler();
}

and in the main:

int main(void) {
  init_timer(...);
  init_power();
  VECTOR_OCIA = my_function();

  ...
}

I thought that it my do the trick. Now my question is how do I call the ROM
handler. I checked the adress in the doc you linked me to (it's 0x36ab), but
i don't exacly know how to call it... it's probably something in assembly,
like "jmp 0x36ab"... can you help me there?

Thanx

Cédric



Message has 1 Reply:
  Re: librcx & interrupt handler
 
(...) You can do this in C. ((void(*)(void))0x36ab)(); (void(*)(void)) is a cast to make 0x36ab a pointer to a void function with no parameters. You then take that and use it as a function. You still have to be careful about register usage and use (...) (22 years ago, 29-Aug-02, to lugnet.robotics.rcx)

Message is in Reply To:
  Re: librcx & interrupt handler
 
(...) The ROM already supports a buffer size of 1 if that is enough for you. The ROM receives a message asynchronously into that buffer, and you can check it whenever you like and respond accordingly. The code I linked to should help you with buffer (...) (22 years ago, 28-Aug-02, to lugnet.robotics.rcx)

7 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