USB Host WAN Dongle library

Fork of USBHostWANDongle_bleedingedge by Donatien Garnier

Files at this revision

API Documentation at this revision

Comitter:
donatien
Date:
Fri May 25 09:31:41 2012 +0000
Parent:
0:ae46a0638b2c
Child:
2:a8b2d0cd9bbd
Commit message:
Memory location change for compat with new lwip lib

Changed in this revision

USB3GModule/WANDongle.cpp Show annotated file Show diff for this revision Revisions of this file
USBHost/USBHALHost.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/USB3GModule/WANDongle.cpp	Thu May 24 16:39:35 2012 +0000
+++ b/USB3GModule/WANDongle.cpp	Fri May 25 09:31:41 2012 +0000
@@ -70,7 +70,7 @@
 
           //Vodafone K3770
           if ((dev->getVid() == 0x12D1) && (dev->getPid() == 0x14D1)) {
-              DBG("Vodafone K3370 dongle detected!!!");
+              DBG("Vodafone K3370 dongle detected in MSD mode");
 
               for (int j = 0; j < dev->getNbInterface(); j++) {
 
@@ -78,17 +78,17 @@
 
                       if ( (bulk_out = dev->getEndpoint(j, BULK_ENDPOINT, OUT)) != NULL )  {
 
-                          DBG("MSD FOUND on device %p, intf %d, WILL NOW SWITCH MODE!!!", (void *)dev, j);
+                          DBG("MSD descriptor found on device %p, intf %d, will now try to switch into serial mode", (void *)dev, j);
 
                           host->bulkWrite(dev, (Endpoint *)bulk_out, vodafone_k3770_switch_packet, 31);
 
-                          DBG("SWITCH PACKET SENT");
+                          DBG("Switch packet sent");
                           host->unlock();
 
 
                           Thread::wait(500); //Not in a thread
 
-                          // now wait for the new device connected......... :(
+                          //Not wait for the dongle to reconnect
                           while (1) {
 
                               if (found) {
@@ -104,10 +104,12 @@
                                   if ((dev = host->getDevice(i)) != NULL) {
                                       host->resetDevice(dev);
                                       host->enumerate(dev);
+                                      
+                                      DBG("Found one device with vid: %04x pid: %04x", dev->getVid(), dev->getPid());
 
                                       //Vodafone K3770
                                       if ((dev->getVid() == 0x12D1) && (dev->getPid() == 0x14C9)) {
-                                          DBG("SWITCH MODE OK!!!!!!!!!!\r\n");
+                                          DBG("Switched successfully");
                                           found = true;
                                           break;
                                       }
--- a/USBHost/USBHALHost.cpp	Thu May 24 16:39:35 2012 +0000
+++ b/USBHost/USBHALHost.cpp	Fri May 25 09:31:41 2012 +0000
@@ -50,7 +50,7 @@
 
 #define TOTAL_SIZE (HCCA_SIZE + (MAX_ENDPOINT*ED_SIZE) + (MAX_TD*TD_SIZE))
 
-static volatile __align(256) uint8_t usb_buf[TOTAL_SIZE] __attribute((section("AHBSRAM0"),aligned));  //256 bytes aligned!
+static volatile __align(256) uint8_t usb_buf[TOTAL_SIZE] __attribute((section("AHBSRAM1"),aligned));  //256 bytes aligned!
 
 USBHALHost * USBHALHost::instHost;