Skip to content

Commit 2abc8cf

Browse files
mlsvrtscarlescufi
authored andcommitted
usb: Handle USB_DC_RESET event notifications
This patch fixes an issue where mcux usb devices may stop functioning after a reset event, because they do not provide a USB_DC_DISCONNECTED event and USB_DC_RESET events were not handled by the forward status callback. Signed-off-by: Jacob Caughfield <[email protected]>
1 parent d0ebeee commit 2abc8cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/usb/usb_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,10 +1184,10 @@ static void forward_status_cb(enum usb_dc_status_code status, const uint8_t *par
11841184
usb_reset_alt_setting();
11851185
}
11861186

1187-
if (status == USB_DC_DISCONNECTED || status == USB_DC_SUSPEND) {
1187+
if (status == USB_DC_DISCONNECTED || status == USB_DC_SUSPEND || status == USB_DC_RESET) {
11881188
if (usb_dev.configured) {
11891189
usb_cancel_transfers();
1190-
if (status == USB_DC_DISCONNECTED) {
1190+
if (status == USB_DC_DISCONNECTED || status == USB_DC_RESET) {
11911191
foreach_ep(disable_interface_ep);
11921192
usb_dev.configured = false;
11931193
}

0 commit comments

Comments
 (0)