STM407 port has working IVT.
[goodfet] / client / GoodFETMAXUSB.py
index 30fb06e..a6bc6fa 100644 (file)
@@ -318,9 +318,11 @@ class GoodFETMAXUSB(GoodFET):
             #Very innefficient, move this to C if performance is needed.
             for j in range(0,pktsize):
                 self.xfrdata=self.xfrdata+[self.rreg(rRCVFIFO)];
+            xfrsize=self.xfrdata[0];
             self.wreg(rHIRQ,bmRCVDAVIRQ); #Clear IRQ
             xfrlen=xfrlen+pktsize; #Add byte count to total transfer length.
             
+            print "%i / %i" % (xfrlen,xfrsize)
             
             #Packet is complete if:
             # 1. The device sent a short packet, <maxPacketSize
@@ -330,7 +332,7 @@ class GoodFETMAXUSB(GoodFET):
                 ashex="";
                 for foo in self.xfrdata:
                     ashex=ashex+(" %02x"%foo);
-                print "INPACKET EP%i==%s" % (endpoint,ashex);
+                print "INPACKET EP%i==%s (0x%02x bytes remain)" % (endpoint,ashex,xfrsize);
                 return resultcode;
 
     RETRY_LIMIT=3;
@@ -408,7 +410,7 @@ class GoodFETMAXUSBHost(GoodFETMAXUSB):
         time.sleep(0.2);
         self.vbus_on();
         
-        self.hostrun();
+        #self.hostrun();
     def hostrun(self):
         """Run as a minimal host and dump the config tables."""
         while 1:
@@ -529,9 +531,12 @@ class GoodFETMAXUSBHost(GoodFETMAXUSB):
         
         if index==0: return "MISSING STRING";
         
-        self.ctl_read(Get_Descriptor_String);
+        status=self.ctl_read(Get_Descriptor_String);
+        if status: return None;
+        
+        #Since we've got a string
         toret="";
-        for c in self.xfrdata:
+        for c in self.xfrdata[2:len(self.xfrdata)]:
             if c>0: toret=toret+chr(c);
         return toret;