diff options
| author | hathach <[email protected]> | 2025-12-15 13:28:24 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-12-15 13:28:24 +0700 |
| commit | 1583864e0b1379cc2f03717f1bed2429e5473407 (patch) | |
| tree | cfd6ebe07681aad890065c1f2cf0524adbe634fa /src/device | |
| parent | 80886fb32a9610d863246726950ffefeb2ffb21b (diff) | |
minor clean up
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/usbd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 5365ae2c2..1a9eb630c 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -574,6 +574,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); @@ -604,7 +606,9 @@ bool tud_deinit(uint8_t rhport) { _usbd_rhport = RHPORT_INVALID; - tud_umount_cb(); + if (cfg_num > 0) { + tud_umount_cb(); + } return true; } |
