Skip to content

Conversation

@rppicomidi
Copy link
Contributor

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.

rppicomidi and others added 2 commits August 14, 2023 15:38
- also rename usbh_classdriver.h to usbh_pvt.h to consitent with usbd
Copy link
Owner

@hathach hathach left a 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 )
Copy link
Owner

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;
Copy link
Owner

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

Copy link
Owner

@hathach hathach left a 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.

@hathach hathach merged commit 7537985 into hathach:master Aug 15, 2023
@harbaum harbaum mentioned this pull request Jun 20, 2024
1 task
mikee47 added a commit to mikee47/Sming-USB that referenced this pull request Jul 5, 2024
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.
mikee47 added a commit to mikee47/Sming-USB that referenced this pull request Jul 5, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants