mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Recover from OUT-NAK
This commit is contained in:
parent
a321ad36ab
commit
82df4b990e
1 changed files with 5 additions and 0 deletions
5
Usb.cpp
5
Usb.cpp
|
@ -388,6 +388,11 @@ uint8_t USB::OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8
|
|||
data_p += bytes_tosend;
|
||||
}//while( bytes_left...
|
||||
breakout:
|
||||
/* If rcode(=rHRSL) is non-zero, untransmitted data remains in the SNDFIFO. */
|
||||
if(rcode != 0) {
|
||||
//Switch the FIFO containing the OUT data back under microcontroller control and reset pointer.
|
||||
regWr(rSNDBC, 0);
|
||||
}
|
||||
|
||||
pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 1 : 0; //bmSNDTOG1 : bmSNDTOG0; //update toggle
|
||||
return ( rcode); //should be 0 in all cases
|
||||
|
|
Loading…
Reference in a new issue