diff options
| author | Zixun LI <[email protected]> | 2025-11-27 11:49:30 +0100 |
|---|---|---|
| committer | Zixun LI <[email protected]> | 2025-11-27 11:49:30 +0100 |
| commit | b997ec725812d2f6a573610ba0dd817f271eddea (patch) | |
| tree | e31f5b4369367f9a5d165d82913f3bbec8db94bf /src/device/usbd.c | |
| parent | a25e9e86c83785e8ce91b1c7b485a106195d368a (diff) | |
usbd: clear state and call callback on deinit
Signed-off-by: Zixun LI <[email protected]>
Diffstat (limited to 'src/device/usbd.c')
| -rw-r--r-- | src/device/usbd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index d4dfae4b4..f923dfe08 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -587,6 +587,10 @@ bool tud_deinit(uint8_t rhport) { } } + // Clear device data + tu_varclr(&_usbd_dev); + usbd_control_reset(); + // Deinit device queue & task osal_queue_delete(_usbd_q); _usbd_q = NULL; @@ -598,6 +602,9 @@ bool tud_deinit(uint8_t rhport) { #endif _usbd_rhport = RHPORT_INVALID; + + tud_umount_cb(); + return true; } |
