mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Fix ESP RTOS WDT corner case
This commit is contained in:
parent
08121e1701
commit
9546dcb722
1 changed files with 6 additions and 0 deletions
6
Usb.cpp
6
Usb.cpp
|
@ -382,11 +382,17 @@ uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) {
|
|||
uint16_t nak_count = 0;
|
||||
|
||||
while((int32_t)((uint32_t)millis() - timeout) < 0L) {
|
||||
#ifdef ESP8266
|
||||
yield(); // needed in order to reset the watchdog timer on the ESP8266
|
||||
#endif
|
||||
regWr(rHXFR, (token | ep)); //launch the transfer
|
||||
rcode = USB_ERROR_TRANSFER_TIMEOUT;
|
||||
|
||||
while((int32_t)((uint32_t)millis() - timeout) < 0L) //wait for transfer completion
|
||||
{
|
||||
#ifdef ESP8266
|
||||
yield(); // needed in order to reset the watchdog timer on the ESP8266
|
||||
#endif
|
||||
tmpdata = regRd(rHIRQ);
|
||||
|
||||
if(tmpdata & bmHXFRDNIRQ) {
|
||||
|
|
Loading…
Reference in a new issue