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:
32:f2d129436056
Parent:
30:ffec1f271b7c
Child:
33:819bbf04163b
--- a/USBHost/USBHost.cpp	Tue Feb 17 10:36:26 2015 +0100
+++ b/USBHost/USBHost.cpp	Wed Oct 23 06:58:55 2019 +0000
@@ -150,7 +150,7 @@
                               break;
                           }
 
-                          Thread::wait(100);
+                          ThisThread::sleep_for(100);
                       }
 
                       USB_INFO("New device connected: %p [hub: %d - port: %d]", &devices[i], usb_msg->hub, usb_msg->port);
@@ -260,7 +260,7 @@
     ((USBHost *)arg)->usb_process();
 }
 
-USBHost::USBHost() : usbThread(USBHost::usb_process_static, (void *)this, osPriorityNormal, USB_THREAD_STACK)
+USBHost::USBHost() : usbThread(osPriorityNormal, USB_THREAD_STACK)
 {
     headControlEndpoint = NULL;
     headBulkEndpoint = NULL;
@@ -294,6 +294,8 @@
     
     listener = NULL;
     listenerSignal = 0;
+    
+    usbThread.start(callback(USBHost::usb_process_static, (void *)this));
 }
 
 USBHost::Lock::Lock(USBHost* pHost) : m_pHost(pHost)
@@ -555,7 +557,7 @@
     int index = findDevice(dev);
     if (index != -1) {
         USB_DBG("Resetting hub %d, port %d\n", dev->getHub(), dev->getPort());
-        Thread::wait(100);
+        ThisThread::sleep_for(100);
         if (dev->getHub() == 0) {
             resetRootHub();
         }
@@ -564,7 +566,7 @@
             dev->getHubParent()->portReset(dev->getPort());
         }
 #endif
-        Thread::wait(100);
+        ThisThread::sleep_for(100);
         deviceReset[index] = true;
         return USB_TYPE_OK;
     }
@@ -914,7 +916,7 @@
     } while(0);
 
     // Some devices may require this delay
-    Thread::wait(100);
+    ThisThread::sleep_for(100);
 
     return USB_TYPE_OK;
 }