Make sure we do not try to send another report before the old one has finished sending

This commit is contained in:
Kristian Sloth Lauszus
2018-06-23 17:33:20 +02:00
parent 14eb9c6ec0
commit 724378cf6c
5 changed files with 60 additions and 25 deletions
+3 -1
View File
@@ -426,8 +426,10 @@ void UpdateUsbReports(void)
UsbSystemKeyboardAction();
}
// Send out the report continuously if the report was not zeros
bool HasUsbMouseReportChanged = false;
if (memcmp(ActiveUsbMouseReport, GetInactiveUsbMouseReport(), sizeof(usb_mouse_report_t)) != 0) {
uint8_t zeroBuf[sizeof(usb_mouse_report_t)] = { 0 };
if (memcmp(ActiveUsbMouseReport, zeroBuf, sizeof(usb_mouse_report_t)) != 0) {
HasUsbMouseReportChanged = true;
usbMouseAction();
}