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
Neil Thiessen 2014-06-11 13:40:18 -06:00
parent 74a051e5e6
commit 2430d649ea
1 changed files with 5 additions and 0 deletions

View File

@ -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)