mirror of
https://github.com/hathach/tinyusb.git
synced 2026-04-02 04:43:47 +00:00
Don't crash on driver without init()
Handle init() like deinit()
This commit is contained in:
@ -544,7 +544,7 @@ bool tuh_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
|
||||
// Class drivers
|
||||
for (uint8_t drv_id = 0; drv_id < TOTAL_DRIVER_COUNT; drv_id++) {
|
||||
usbh_class_driver_t const* driver = get_driver(drv_id);
|
||||
if (driver != NULL) {
|
||||
if (driver != NULL && driver->init) {
|
||||
TU_LOG_USBH("%s init\r\n", driver->name);
|
||||
driver->init();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user