USB: work around OSX behaviour where if the device disconnects and quickly reconnects...
authorMichael Moon <triffid.hunter@gmail.com>
Wed, 6 Feb 2013 08:03:54 +0000 (19:03 +1100)
committerMichael Moon <triffid.hunter@gmail.com>
Wed, 6 Feb 2013 08:03:54 +0000 (19:03 +1100)
src/libs/USBDevice/USBDevice/USBHAL_LPC17.cpp

index 62b382d..0c8c759 100644 (file)
@@ -24,7 +24,6 @@
 #include "USBHAL.h"\r
 \r
 #include <cstdio>\r
-\r
 #include <LPC17xx.h>\r
 \r
 #ifdef MBED\r
@@ -33,6 +32,8 @@
     #include <lpc17xx_nvic.h>\r
 #endif\r
 \r
+#include "wait_api.h"\r
+\r
 #include "debug.h"\r
 \r
 #ifndef ENTER_ISR\r
@@ -470,6 +471,9 @@ void USBHAL::init() {
     // Disconnect USB device\r
     SIEdisconnect();\r
 \r
+    // work around OSX behaviour where if the device disconnects and quickly reconnects, it assumes it's the same device instead of checking\r
+    wait_ms(1000);\r
+\r
     // Configure pin P2.9 to be Connect\r
     LPC_PINCON->PINSEL4 &= 0xfffcffff;\r
     LPC_PINCON->PINSEL4 |= 0x00040000;\r