Fix openrgb RAW set led drop issue

should handle nak if the device can't keep up PC writing speed (3~5 64-byte packet sequentially)
This commit is contained in:
Glory 2021-09-18 16:28:10 +08:00 committed by Dimitris Mantzouranis
parent 181e4b3ed7
commit d898dafe19
1 changed files with 9 additions and 3 deletions

View File

@ -557,10 +557,16 @@ void handleNAK(USBDriver *usbp, usbep_t ep) {
if(out) if(out)
{ {
if (nakcnt[ep] < 1) {
// NAK 1 time
USB_EPnNak(ep);
nakcnt[ep]++;
} else {
// By acking next OUT token from host we are allowing reception // By acking next OUT token from host we are allowing reception
// of the data from host // of the data from host
USB_EPnAck(ep, 0); USB_EPnAck(ep, 0);
} }
}
else else
{ {
// This is not a retransmission, retransmission is transparent and happens on phy layer // This is not a retransmission, retransmission is transparent and happens on phy layer