twitchyliquid64 / usbd-hid

MIT License
88 stars 37 forks source link

new maybe_push_input() method to HIDClass #34

Closed mutantbob closed 7 months ago

mutantbob commented 2 years ago

The push_input() API for HIDClass is a little clumsy because it returns an error if the write would block, forcing the code that invokes it to hang on to the buffer and retry later.

This is a solution, but it requires changes to the UsbBus trait ( https://github.com/mvirkkunen/usb-device/pull/78 )

I am mostly trying to start a conversation about this so options (such as the ability to check WouldBlock before calling push_input) can be discussed.