USB: ensure Connect pin is set up before disconnect delay
authorMichael Moon <triffid.hunter@gmail.com>
Wed, 6 Feb 2013 08:28:29 +0000 (19:28 +1100)
committerMichael Moon <triffid.hunter@gmail.com>
Wed, 6 Feb 2013 08:28:29 +0000 (19:28 +1100)
src/libs/USBDevice/USBDevice/USBHAL_LPC17.cpp

index 0c8c759..dc2cd0e 100644 (file)
@@ -468,16 +468,16 @@ void USBHAL::init() {
     LPC_PINCON->PINSEL1 &= 0xc3ffffff;\r
     LPC_PINCON->PINSEL1 |= 0x14000000;\r
 \r
+    // Configure pin P2.9 to be Connect\r
+    LPC_PINCON->PINSEL4 &= 0xfffcffff;\r
+    LPC_PINCON->PINSEL4 |= 0x00040000;\r
+\r
     // 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
-\r
     // Connect must be low for at least 2.5uS\r
     //     wait(0.3);\r
 \r