Adaptation of the official mbed USBHost repository to work with the LPC4088 Display Module

Dependents:   DMSupport DMSupport DMSupport DMSupport

Fork of DM_USBHost by EmbeddedArtists AB

Revision:
31:9a462d032742
Parent:
27:aa2fd412f1d3
Child:
32:f2d129436056
--- a/USBHost/USBHALHost.cpp	Tue Jan 20 09:09:10 2015 +0100
+++ b/USBHost/USBHALHost.cpp	Tue Feb 17 10:36:26 2015 +0100
@@ -122,7 +122,7 @@
 
     //Cut power
     LPC_SC->PCONP &= ~(1UL<<31);
-    wait_ms(1000);
+    Thread::wait(1000);
 
     // turn on power for USB
     LPC_SC->PCONP       |= (1UL<<31);
@@ -166,7 +166,7 @@
     USB_DBG("initialize OHCI\n");
 
     // Wait 100 ms before apply reset
-    wait_ms(100);
+    Thread::wait(100);
 
     LPC_USB->HcControl       = 0; // HARDWARE RESET
     LPC_USB->HcControlHeadED = 0; // Initialize Control list head to Zero
@@ -206,7 +206,7 @@
 
     if (LPC_USB->HcRhPortStatus2 & OR_RH_PORT_CCS) {
         //Device connected
-        wait_ms(150);
+        Thread::wait(150);
         USB_DBG("Device connected (%08x)\n\r", LPC_USB->HcRhPortStatus2);
         deviceConnected(0, 2, LPC_USB->HcRhPortStatus2 & OR_RH_PORT_LSDA);
     }
@@ -331,7 +331,7 @@
 
     DigitalOut usb2_vbus_en(P0_12);
     usb2_vbus_en = 1;
-    wait_ms(100); /* USB 2.0 spec says at least 50ms delay before port reset */
+    Thread::wait(100); /* USB 2.0 spec says at least 50ms delay before port reset */
 
     // Initiate port reset
     LPC_USB->HcRhPortStatus1 = OR_RH_PORT_PRS;
@@ -352,7 +352,7 @@
     LPC_USB->HcRhPortStatus2 = OR_RH_PORT_PRSC;
     
     usb2_vbus_en = 1;
-    wait_ms(200); /* Wait for 100 MS after port reset  */
+    Thread::wait(200); /* Wait for at least 100 MS after port reset */
 }