[USB Device]fix an error on msc

This commit is contained in:
ZYH
2017-12-21 21:26:40 +08:00
parent ac278da0aa
commit 92f5b437f7
2 changed files with 8 additions and 3 deletions

View File

@@ -2144,8 +2144,9 @@ static void rt_usbd_thread_entry(void* parameter)
break;
case USB_MSG_RESET:
RT_DEBUG_LOG(RT_DEBUG_USB, ("reset %d\n", device->state));
if (device->state == USB_STATE_ADDRESS)
if (device->state == USB_STATE_ADDRESS || device->state == USB_STATE_CONFIGURED)
_stop_notify(device);
device->state = USB_STATE_NOTATTACHED;
break;
case USB_MSG_PLUG_IN:
device->state = USB_STATE_ATTACHED;