mirror of https://github.com/ARMmbed/mbed-os.git
Reset device to initial state in disconnect()
Added code to reset the device to the initial state when disconnect() is called. This prevents calls to configured() from returning true when the device has been disconnected.pull/353/head
parent
74a051e5e6
commit
2430d649ea
|
@ -718,6 +718,11 @@ void USBDevice::disconnect(void)
|
|||
{
|
||||
/* Disconnect device */
|
||||
USBHAL::disconnect();
|
||||
|
||||
/* Set initial device state */
|
||||
device.state = POWERED;
|
||||
device.configuration = 0;
|
||||
device.suspended = false;
|
||||
}
|
||||
|
||||
CONTROL_TRANSFER * USBDevice::getTransferPtr(void)
|
||||
|
|
Loading…
Reference in New Issue