aboutsummaryrefslogtreecommitdiffstats
path: root/src/lpc176x/usbserial.c
diff options
context:
space:
mode:
authorMatt Baker <baker.matt.j@gmail.com>2019-04-06 15:12:51 -0700
committerKevinOConnor <kevin@koconnor.net>2019-04-06 20:53:15 -0400
commite83071c9fef2d1b347fec4aa41650fe0950c60f8 (patch)
tree1638503857f0ad7b39db9ce35c59e48a1936b567 /src/lpc176x/usbserial.c
parent04adde9a021d7c25bbf8f3011dc432893c99d4db (diff)
downloadkutter-e83071c9fef2d1b347fec4aa41650fe0950c60f8.tar.gz
kutter-e83071c9fef2d1b347fec4aa41650fe0950c60f8.tar.xz
kutter-e83071c9fef2d1b347fec4aa41650fe0950c60f8.zip
lpc176x: force minimum usb disconnect time
Fixes GitHub Issue #1499. Resolves USB hang by forcing a minimum USB disconnection time at boot. Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
Diffstat (limited to 'src/lpc176x/usbserial.c')
-rw-r--r--src/lpc176x/usbserial.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lpc176x/usbserial.c b/src/lpc176x/usbserial.c
index 18466da7..b2e67467 100644
--- a/src/lpc176x/usbserial.c
+++ b/src/lpc176x/usbserial.c
@@ -277,6 +277,8 @@ usbserial_init(void)
gpio_peripheral(GPIO(0, 30), 1, 0);
gpio_peripheral(GPIO(0, 29), 1, 0);
gpio_peripheral(GPIO(2, 9), 1, 0);
+ // enforce a minimum time bus is disconnected before connecting
+ udelay(5000);
// setup endpoints
realize_endpoint(EP0OUT, USB_CDC_EP0_SIZE);
realize_endpoint(EP0IN, USB_CDC_EP0_SIZE);