Host & Device on separate cores? #1435
ATMakersBill
started this conversation in
General
Replies: 1 comment 3 replies
-
There should be no problems with each stack on its core and/or any combination of core + code as long as mutex is implemented correctly. just go ahead with your plan and file an issue if there is one
can you paste that line here, so I could correct it. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am looking to use the new PIO Host mode to make HID Filters. Specifically, we have filters that take non-standard (raw) HID and convert them to a composite Mouse + Keyboard that allows the old IntelliKeys keyboards to work for those who need them (primarily for those with cerebral palsy). In addition, I'd like to make 'filtering" devices that take in (for example) a Mouse and expose the mouse out after a transform. This would really help AT projects we're working on.
Our current filters use to MCUs: one playing the part of Host and one mimicking an HID Device. So, for example, we use two Trinkets for this on the current IntelliKeys filters.
This makes for a nice separation of logic: the host side simply reads the reports and maintains a "current state" of which keys and buttons are pressed and the net motion of the mouse. The device side polls and gets the updated state, sending appropriate reports out on the device connection. This eliminates the problem if "stuck keys" where the key-up event is missed and solves the issues where one side (host/device) is significantly faster than the other.
So: I'd like to keep this approach in TinyUSB. However, in your concurrency doc, it says this is designed for a single core MCU. Does that mean I can't run the device code in a separate core from the host code?
Ideally, I'd like to have the main thread manage the host side, updating a shared "current state" structure that the second core of the RP2040 can read and send mouse & keyboard reports out the device side.
Is this a bad plan? Will I have concurrency issues here? Has anyone done anything like this?
Thanks
Bill
Beta Was this translation helpful? Give feedback.
All reactions