mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
bugfix
This commit is contained in:
parent
a50baa8aec
commit
f6244bbe59
2 changed files with 4 additions and 4 deletions
6
Usb.cpp
6
Usb.cpp
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue