This commit is contained in:
Andrew J. Kroll 2014-05-24 00:31:26 -04:00
parent a50baa8aec
commit f6244bbe59
2 changed files with 4 additions and 4 deletions

View file

@ -327,7 +327,7 @@ uint8_t USB::OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8
regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ
rcode = (regRd(rHRSL) & 0x0f);
while(rcode && ((long)(millis() - timeout) >= 0L)) {
while(rcode && ((long)(millis() - timeout) < 0L)) {
switch(rcode) {
case hrNAK:
nak_count++;
@ -380,11 +380,11 @@ uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) {
uint8_t retry_count = 0;
uint16_t nak_count = 0;
while((long)(millis() - timeout) >= 0L) {
while((long)(millis() - timeout) < 0L) {
regWr(rHXFR, (token | ep)); //launch the transfer
rcode = USB_ERROR_TRANSFER_TIMEOUT;
while((long)(millis() - timeout) >= 0L) //wait for transfer completion
while((long)(millis() - timeout) < 0L) //wait for transfer completion
{
tmpdata = regRd(rHIRQ);

View file

@ -97,7 +97,7 @@ void loop()
if( Usb.getUsbTaskState() == USB_STATE_RUNNING )
{
if ((next_time - millis()) >= 0L)
if ((millis() - next_time) >= 0L)
{
Usb.ForEachUsbDevice(&PrintAllDescriptors);
Usb.ForEachUsbDevice(&PrintAllAddresses);