Utilising JaRule code #10
Replies: 1 comment 2 replies
-
Indeed, good note. I actually didn't dig too deep into the firmware's source code since the docs at https://docs.openlighting.org/ole/doc/latest/md_doxygen_message-format.html#message-transport were talking about certain conditions triggering interrupts on the Microchip-side that just don't happen on the RP2040. Handling the "serial port" part, especially for RDM will also differ a lots since there just are no 8 UARTs on the RP2040 and there will be a lot of juggling code around the PIO state machines. But in general I do agree that we should try to re-use as much as possible of what's already there and proven to be working 👍 |
Beta Was this translation helpful? Give feedback.
-
Possibly a bit of an involved one, but have you considered utilising some of the JaRule codebase
https://github.com/OpenLightingProject/ja-rule/blob/master/firmware/src/rdm_util.h
Even bits like the JaRule protocol stuff look like they should just work standalone:
https://github.com/OpenLightingProject/ja-rule/blob/master/firmware/src/stream_decoder.c
For example it's only this bit you'd need to change to use your other USB library:
https://github.com/OpenLightingProject/ja-rule/blob/0e4bf7bd6e944222f1b64996c93c3ac87a607de5/firmware/src/usb_transport.c#L378-L387
I may be being very naive here, but it looks fairly promising.
It's always struck me when contributing to Arduino and Teensy DMX/RDM libraries that once you've got an array of bytes off the line the code is nearly identical!
Beta Was this translation helpful? Give feedback.
All reactions