-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix issue 2188: support usbh_app_driver_get_cb() #2222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- also rename usbh_classdriver.h to usbh_pvt.h to consitent with usbd
hathach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you everything look great, I have go through the changes. and also add a few changes and rename as well to be consistent with usbd.
src/host/usbh.c
Outdated
| } | ||
| } | ||
|
|
||
| if( drv_id >= _total_driver_count ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
src/host/usbh.c
Outdated
|
|
||
| static usbh_class_driver_t const * usbh_get_driver(uint8_t drv_id) | ||
| { | ||
| usbh_class_driver_t const * driver = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, this remind me to double check usbd, for reason why I write it a bit compliated there. Seem like I was trying to give clue to compiler to optimize out when driver callback is not available. Though, think again now, it only for link time optimization (LTO), and does not seem to save much code as well. This is much cleaner code. thanks
hathach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all is good, thank you very much for your PR. After this is merged, if posible, please keep the midihost pr open, I really want to merge that one, but haven't got time just yet due to crzay work previously. Will try to wrap it up soon enough.
General tinyusb imporovements and fixes. The main change affecting this library is hathach/tinyusb#2222 which provides a `usbh_app_driver_get_cb` callback for registering custom (vendor) host devices. This replaces the obsolete `vendor_host` module which has been patched out. Application code remains unchanged.
General tinyusb imporovements and fixes. The main change affecting this library is hathach/tinyusb#2222 which provides a `usbh_app_driver_get_cb` callback for registering custom (vendor) host devices. This replaces the obsolete `vendor_host` module which has been patched out. Application code remains unchanged.
Describe the PR
This pull request implements a fix to issue #2188. To add an application host driver, implement the callback
usbh_app_driver_get_cb().Additional context
This implementation should be consistent with the
usbd_app_driver_get_cb()method implemented for application defined USB device drivers.