Merge pull request #10651 from desowin/usbhost-set-address-wait

USBHost: Wait for device to implement SET ADDRESS
pull/10739/head
Martin Kojtal 2019-05-31 12:37:19 +01:00 committed by GitHub
commit a8444bd6ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -163,6 +163,13 @@ void USBHost::usb_process()
devices[i].activeAddress(true);
USB_DBG("Address of %p: %d", &devices[i], devices[i].getAddress());
// Wait for the device to actually set the address. The Status stage
// of SET ADDRESS happens before the device implements the request.
// According to Universal Serial Bus Specification Revision 2.0 chapter
// 9.2.6.3 Set Address Processing, the device is allowed SetAddress()
// recovery interval of 2 ms.
ThisThread::sleep_for(2);
// try to read again the device descriptor to check if the device
// answers to its new address
res = getDeviceDescriptor(&devices[i], buf, 8);