Skip to content

Commit a8444bd

Browse files
authored
Merge pull request #10651 from desowin/usbhost-set-address-wait
USBHost: Wait for device to implement SET ADDRESS
2 parents 523ad23 + a39cba0 commit a8444bd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

features/unsupported/USBHost/USBHost/USBHost.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ void USBHost::usb_process()
163163
devices[i].activeAddress(true);
164164
USB_DBG("Address of %p: %d", &devices[i], devices[i].getAddress());
165165

166+
// Wait for the device to actually set the address. The Status stage
167+
// of SET ADDRESS happens before the device implements the request.
168+
// According to Universal Serial Bus Specification Revision 2.0 chapter
169+
// 9.2.6.3 Set Address Processing, the device is allowed SetAddress()
170+
// recovery interval of 2 ms.
171+
ThisThread::sleep_for(2);
172+
166173
// try to read again the device descriptor to check if the device
167174
// answers to its new address
168175
res = getDeviceDescriptor(&devices[i], buf, 8);

0 commit comments

Comments
 (0)