summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiPeng <[email protected]>2024-08-06 13:49:14 +0800
committersakumisu <[email protected]>2024-08-06 14:10:07 +0800
commitdfc90da28a4348222b97ea093c2b59a7a39c923e (patch)
treea6d075fc3a5974937450bec51494079cd94bd13a
parent8451bc64bbac15bb51116cfdf364607c5a48e3ec (diff)
Fix the bug that USBD_EVENT_DEINIT was not notified correctly
-rw-r--r--core/usbd_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/usbd_core.c b/core/usbd_core.c
index 8fdee7bf..9535f210 100644
--- a/core/usbd_core.c
+++ b/core/usbd_core.c
@@ -1397,9 +1397,9 @@ int usbd_initialize(uint8_t busid, uint32_t reg_base, void (*event_handler)(uint
int usbd_deinitialize(uint8_t busid)
{
- g_usbd_core[busid].intf_offset = 0;
- usb_dc_deinit(busid);
- usbd_class_event_notify_handler(busid, USBD_EVENT_DEINIT, NULL);
g_usbd_core[busid].event_handler(busid, USBD_EVENT_DEINIT);
+ usbd_class_event_notify_handler(busid, USBD_EVENT_DEINIT, NULL);
+ usb_dc_deinit(busid);
+ g_usbd_core[busid].intf_offset = 0;
return 0;
}