EthernetNetIf Compatibility.

Dependents:   XBeeWiFi_SPI_example

Fork of NetServicesSource by Donatien Garnier

Revision:
5:dd63a1e02b1b
Parent:
4:fd826cad83c0
--- a/drv/usb/UsbHostMgr.cpp	Fri Jul 09 14:46:47 2010 +0000
+++ b/drv/usb/UsbHostMgr.cpp	Tue Jul 27 15:59:42 2010 +0000
@@ -61,7 +61,7 @@
 
 UsbHostMgr::UsbHostMgr() : m_lpDevices()
 {
-  if(!pMgr)
+  /*if(!pMgr)*/ //Assume singleton
     pMgr = this;
   usb_mem_init();
   memset(m_lpDevices, NULL, sizeof(UsbDevice*) * USB_HOSTMGR_MAX_DEVS);
@@ -165,6 +165,15 @@
 
 void UsbHostMgr::poll() //Enumerate connected devices, etc
 {
+  /* Check for any connected devices */
+  if (LPC_USB->HcRhPortStatus1 & OR_RH_PORT_CCS)  //Root device connected
+  {
+    //Device connected
+    wait(1);
+    DBG("Device connected (%08x)\n", LPC_USB->HcRhPortStatus1);
+    onUsbDeviceConnected(0, 1); //Hub 0 (root hub), Port 1 (count starts at 1)
+  }
+  
   for(int i = 0; i < devicesCount(); i++)
   {
     if( (m_lpDevices[i]->m_connected)