Subject:
|
Re: librcx & interrupt handler
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Thu, 29 Aug 2002 19:41:29 GMT
|
Viewed:
|
2689 times
|
| |
| |
Cédric Meuter <cedric.meuter@ulb.ac.be> wrote:
> 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?
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 the necessary
wrapper code to make sure the C code does not stomp on unsaved registers.
I didn't see this code in the example you posted.
-Kekoa
|
|
Message has 1 Reply: | | Re: librcx & interrupt handler
|
| Hi (...) i thought of that... but it seemed too easy... (...) here's what I wrote, and so far it seems to work proprly (tell me if I'm wrong): #include <timer.h> #include <null.h> #include <irq.h> static char _timer_data[64]; #define save_reg() (...) (22 years ago, 30-Aug-02, to lugnet.robotics.rcx)
|
Message is in Reply To:
| | Re: librcx & interrupt handler
|
| 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 (...) (22 years ago, 29-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
|
|
|
|