diff options
| author | Ha Thach <[email protected]> | 2025-12-15 16:01:15 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-15 16:01:15 +0700 |
| commit | 9a22543bd2b97455045fa2810b67f7c2b8f6b8d0 (patch) | |
| tree | bde4580e644f0adb582e138249049aab313ca826 /src/device/usbd.c | |
| parent | ad5fe66f19e8fb633f175affcfa27b8376e40639 (diff) | |
| parent | 1583864e0b1379cc2f03717f1bed2429e5473407 (diff) | |
Merge pull request #3364 from hathach/hcd_fsdev
hcd: add stm32_fsdev driver
Diffstat (limited to 'src/device/usbd.c')
| -rw-r--r-- | src/device/usbd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index e337a5000..1e21c667a 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -580,6 +580,8 @@ bool tud_deinit(uint8_t rhport) { TU_LOG_USBD("USBD deinit on controller %u\r\n", rhport); + const uint8_t cfg_num = _usbd_dev.cfg_num; + // Deinit device controller driver dcd_int_disable(rhport); dcd_disconnect(rhport); @@ -594,6 +596,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; @@ -605,6 +611,11 @@ bool tud_deinit(uint8_t rhport) { #endif _usbd_rhport = RHPORT_INVALID; + + if (cfg_num > 0) { + tud_umount_cb(); + } + return true; } |
