|
|
@@ -1364,9 +1364,9 @@ int usbd_initialize(uint8_t busid, uintptr_t reg_base, void (*event_handler)(uin
|
|
|
#endif
|
|
|
|
|
|
g_usbd_core[busid].event_handler = event_handler;
|
|
|
- ret = usb_dc_init(busid);
|
|
|
usbd_class_event_notify_handler(busid, USBD_EVENT_INIT, NULL);
|
|
|
g_usbd_core[busid].event_handler(busid, USBD_EVENT_INIT);
|
|
|
+ ret = usb_dc_init(busid);
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
@@ -1374,8 +1374,6 @@ int usbd_deinitialize(uint8_t busid)
|
|
|
{
|
|
|
USB_ASSERT_MSG(busid < CONFIG_USBDEV_MAX_BUS, "bus overflow\r\n");
|
|
|
|
|
|
- g_usbd_core[busid].event_handler(busid, USBD_EVENT_DEINIT);
|
|
|
- usbd_class_event_notify_handler(busid, USBD_EVENT_DEINIT, NULL);
|
|
|
usb_dc_deinit(busid);
|
|
|
#ifdef CONFIG_USBDEV_EP0_THREAD
|
|
|
if (g_usbd_core[busid].usbd_ep0_thread) {
|
|
|
@@ -1385,6 +1383,7 @@ int usbd_deinitialize(uint8_t busid)
|
|
|
usb_osal_mq_delete(g_usbd_core[busid].usbd_ep0_mq);
|
|
|
}
|
|
|
#endif
|
|
|
-
|
|
|
+ g_usbd_core[busid].event_handler(busid, USBD_EVENT_DEINIT);
|
|
|
+ usbd_class_event_notify_handler(busid, USBD_EVENT_DEINIT, NULL);
|
|
|
return 0;
|
|
|
}
|