USB Host Library for Sprint Dongles

Fork of USBHostWANDongleSprint by mbed official

Revision:
6:aaf432a6819b
Parent:
5:99f453c4756b
Parent:
4:cd9864d1db52
Child:
8:65cd51339647
--- a/USB3GModule/WANDongleInitializer.cpp	Wed Oct 10 08:20:39 2012 +0000
+++ b/USB3GModule/WANDongleInitializer.cpp	Wed Oct 10 08:29:36 2012 +0000
@@ -75,14 +75,11 @@
     {
       m_hasSwitched = true;
       m_currentSerialIntf = 0;
-      m_endpointsToFetch = 2;
-      m_endpointsToSkip = 0;
+      m_currentEndpoint = 0;
     }
     else
     {
       m_hasSwitched = false;
-      m_endpointsToFetch = 0;
-      m_endpointsToSkip = 0;
     }
 }
 
@@ -109,16 +106,16 @@
   if( m_hasSwitched )
   {
     DBG("USBEndpoint on Interface #%d; Type:%d; Direction:%d", intf_nb, type, dir);
-    if( (type == BULK_ENDPOINT) && m_endpointsToFetch )
+    if(type == BULK_ENDPOINT)
     {
-      if(!m_endpointsToSkip)
+      if( (m_currentEndpoint >= 0) && (m_currentEndpoint < 2) )
       {
-        m_endpointsToFetch--;
+        m_currentEndpoint++;
         return true;
       }
       else
       {
-        m_endpointsToSkip--;
+        m_currentEndpoint++;
       }
     }
   }