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,9 +557,15 @@ void handleNAK(USBDriver *usbp, usbep_t ep) {
if(out)
{
// By acking next OUT token from host we are allowing reception
// of the data from host
USB_EPnAck(ep, 0);
if (nakcnt[ep] < 1) {
// NAK 1 time
USB_EPnNak(ep);
nakcnt[ep]++;
} else {
// By acking next OUT token from host we are allowing reception
// of the data from host
USB_EPnAck(ep, 0);
}
}
else
{