Never do lots of things in an interrupt function. One example of a useful interrupt style is the top half and bottom half scheme on Linux. The top half is the actual interrupt function, which finishes as quickly as possible. The bottom half can be scheduled along with lower priority stuff.
In your case, it does not sound like you have extreme data transfer requirements -- gamecubeconsole and GCcontroller, so the interrupt function can set a flag, and then the sending data part can be handled elsewhere. If the data transfer rate is fairly low, just handle all the tasks in the main loop. 133 MHz -- you can do plenty at that speed and you can always overclock it.
A common USB mouse sends notifications at 1 kHz, so I'm guessing the controller data rate should be low as well. The flag is only for notification, which should be sufficient unless you have extreme timing requirements. Low data rates and some flags... I'm sure the code can be restructured to avoid any blocking calls.
[Edit] You can always receive the data and put it somewhere on high priority. Receive and send should not block each other. There's plenty of performance and plenty of resources -- it's a matter of using them properly.
In your case, it does not sound like you have extreme data transfer requirements -- gamecubeconsole and GCcontroller, so the interrupt function can set a flag, and then the sending data part can be handled elsewhere. If the data transfer rate is fairly low, just handle all the tasks in the main loop. 133 MHz -- you can do plenty at that speed and you can always overclock it.
A common USB mouse sends notifications at 1 kHz, so I'm guessing the controller data rate should be low as well. The flag is only for notification, which should be sufficient unless you have extreme timing requirements. Low data rates and some flags... I'm sure the code can be restructured to avoid any blocking calls.
[Edit] You can always receive the data and put it somewhere on high priority. Receive and send should not block each other. There's plenty of performance and plenty of resources -- it's a matter of using them properly.
Statistics: Posted by katak255 — Wed Dec 04, 2024 4:39 pm