| | 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)
|
|
| | 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)
|
|
| | 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)
|
|
| | 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)
|