altos/lpc: Make sure USB pull-up is held low at boot for 'a while'
authorKeith Packard <keithp@keithp.com>
Tue, 9 Oct 2018 02:42:09 +0000 (19:42 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 9 Oct 2018 02:42:09 +0000 (19:42 -0700)
Add a delay loop to make sure the host sees the pull-up low for long
enough.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lpc/ao_usb_lpc.c

index c50e752883faca07f5d92b0965c203d2db160eaf..d26a1437f9b34c94e8d8c93ca1ea051c8fe0906d 100644 (file)
@@ -1013,7 +1013,11 @@ void
 ao_usb_init(void)
 {
 #if HAS_USB_PULLUP
+       int     i;
        ao_enable_output(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0);
+
+       for (i = 0; i < 40000; i++)
+               ao_arch_nop();
 #endif
        ao_usb_enable();