eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
154 stars 89 forks source link

How about a callback when new event is received in receiver thread #44

Closed gawied closed 2 years ago

gawied commented 2 years ago

First of all thank you vey much for adding support for optional OUT endpoint.

The current code structure calls for another thread to poll the ux_device_class_hid_receiver_event_get() function in order to be notified when new events are received data on the OUT endpoint. How about adding a callback function, which can be part of the UX_DEVICE_CLASS_HID_RECEIVER structure, that will be called when the _ux_device_class_hid_receiver_thread determines that a new event was received. This will eliminate another polling thread and the system will be more event driven as well.

I certainly might have interpreted the new code incorrectly and would appreciate it if there are other ways than a polling thread to get notified of new received events.

ayedmo commented 2 years ago

@gawied same idee, i think that is helpful to add a callback when received data from Host.

xiaocq2001 commented 2 years ago

Thanks for the suggestion, we will put that feature in our plan.

gawied commented 2 years ago

Thanks that will be great!

Any idea on the time span of your plan? What are we talking about here - weeks, months?

yuxin-azrtos commented 2 years ago

This callback will be added to the next release of Azure RTOS (towards the end of April 2022).

gawied commented 2 years ago

Thanks!