mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-05 09:15:41 +00:00
usbd: clear state and call callback on deinit
Signed-off-by: Zixun LI <admin@hifiphile.com>
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user