self.wreg(rEPIRQ,bmOUT1DAVIRQ); #Clear the bit *AFTER* servicing.
if(epirq&bmIN3BAVIRQ): #IN3-IN packet
self.do_IN3();
- self.wreg(rEPIRQ,bmIN3BAVIRQ); #Clear the bit
+ #self.wreg(rEPIRQ,bmIN3BAVIRQ); #Clear the bit
if(epirq&bmIN2BAVIRQ): #IN2 packet
self.do_IN2();
- self.wreg(rEPIRQ,bmIN2BAVIRQ); #Clear the bit
+ #self.wreg(rEPIRQ,bmIN2BAVIRQ); #Clear the bit
#else:
# print "No idea how to service this IRQ: %02x" % epirq;
def do_IN2(self):
def do_IN3(self):
"""Handle IN3 input event."""
- #Don't bother clearing interrupt flag, that's done by sending the reply.
- print "Got an input event, no idea what to do about it.";
- #This would be for FTDI emulation. Not for Mass Storage.
- #self.wreg(rEP3INFIFO,0x01); #Modem
- #self.wreg(rEP3INFIFO,0x00); #Line
- #self.wreg(rEP3INFIFO,0x00);
- #self.wregAS(rEP3INBC,0);
-
+ # Do nothing here, as it'll be taken care of elsewhere. The
+ # interrupt just means that the buffer is empty, not that we
+ # are expected to fill it.
def do_OUT1(self):
"""Handle an OUT1 output event."""
l=self.rreg(rEP1OUTBC);
frame=self.readbytes(rEP1OUTFIFO,l);
self.handleCBW(frame);
+
lastCBW="";
def handleCBW(self,cbw):
"""Handles an incoming Command Block Wrapper. See USB Mass
#CBW key; must be the same as the one we're replying to.
ord(cbw[4]),ord(cbw[5]),ord(cbw[6]),ord(cbw[7]),
#CSW Data Residue, probably oughtn't be zeroed.
- 0,0,0,
+ 0,0,0,0,
#Status byte: 00 for good, 01 for bad.
status];
self.writebytes(rEP3INFIFO,