USB Host WAN Dongle library

Fork of USBHostWANDongle_bleedingedge by Donatien Garnier

Revision:
3:4394986752db
Parent:
0:ae46a0638b2c
Child:
6:075e36a3463e
--- a/USBHost/USBHost.cpp	Tue Jun 26 13:43:54 2012 +0000
+++ b/USBHost/USBHost.cpp	Fri Jul 06 08:53:17 2012 +0000
@@ -29,7 +29,7 @@
 #include "rtos.h"
 
 
-#define NB_MAX_INTF 3
+#define NB_MAX_INTF 5
 
 USBHost * USBHost::instHost = NULL;
 
@@ -662,7 +662,7 @@
     case CONFIGURATION_DESCRIPTOR:
       break;
     case INTERFACE_DESCRIPTOR:
-      if (intf_nb++ < NB_MAX_INTF) {
+      if (intf_nb++ <= NB_MAX_INTF) {
         dev->addInterface(intf_nb - 1, conf_descr[index + 5], conf_descr[index + 6], conf_descr[index + 7]);
         nb_endpoints_used = 0;
         DBG("ADD INTF %d on device %p: class: %d, subclass: %d, proto: %d", intf_nb - 1, (void *)dev, conf_descr[index + 5],conf_descr[index + 6],conf_descr[index + 7]);
@@ -671,7 +671,8 @@
       }
       break;
     case ENDPOINT_DESCRIPTOR:
-      if (intf_nb < NB_MAX_INTF) {
+      DBG("Ep DESC");
+      if (intf_nb <= NB_MAX_INTF) {
         if (nb_endpoints_used < MAX_ENDPOINT_PER_INTERFACE) {
           // if the endpoint is isochronous -> skip it (TODO: fix this)
           if ((conf_descr[index + 3] & 0x03) != ISOCHRONOUS_ENDPOINT) {
@@ -683,7 +684,7 @@
             if (ep != NULL && dev != NULL) {
               addEndpoint(dev, intf_nb - 1, ep);
             } else {
-              DBG("EP NULL\r\n");
+              DBG("EP NULL");
             }
             nb_endpoints_used++;
           } else {
@@ -691,7 +692,7 @@
           }
         }
       }
-      //DBG("ENDPOINT DESCR\r\n");
+      //DBG("ENDPOINT DESCR");
       break;
     case HID_DESCRIPTOR:
       lenReportDescr = conf_descr[index + 7] | (conf_descr[index + 8] << 8);