Skip to content

Commit 12bc14d

Browse files
committed
USBHost: add retry on enumeration fail
1 parent 3f4e2d5 commit 12bc14d

File tree

1 file changed

+3
-2
lines changed
  • libraries/USBHOST/src/class/host

1 file changed

+3
-2
lines changed

libraries/USBHOST/src/class/host/tusbh.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,9 @@ static void tusbh_msg_root_enable(tusbh_message_t* msg)
835835
dev->host = host;
836836
dev->speed = tusb_port_get_speed(host, port);
837837
tusb_delay_ms(100);
838-
res = tusbh_device_attach(dev);
839-
if(res!=0){
838+
res = -1;
839+
while (res!=0){
840+
res = tusbh_device_attach(dev);
840841
TUSB_ROOT_INFO("Device attach failed\n");
841842
}
842843
}

0 commit comments

Comments
 (0)