#Very innefficient, move this to C if performance is needed.
for j in range(0,pktsize):
self.xfrdata=self.xfrdata+[self.rreg(rRCVFIFO)];
#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.
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
#Packet is complete if:
# 1. The device sent a short packet, <maxPacketSize
ashex="";
for foo in self.xfrdata:
ashex=ashex+(" %02x"%foo);
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;
return resultcode;
RETRY_LIMIT=3;
//Setup the configuration pins.
//This might need some delays.
CLRRST; //Put the chip into RESET.
//Setup the configuration pins.
//This might need some delays.
CLRRST; //Put the chip into RESET.
- debugstr("MAXUSB is off.");
+ //debugstr("MAXUSB is off.");
SETSS; //Deselect the chip, end any existing transation.
SETRST; //Bring the chip out of RESET.
SETSS; //Deselect the chip, end any existing transation.
SETRST; //Bring the chip out of RESET.
- debugstr("MAXUSB is on.");
+ //debugstr("MAXUSB is on.");