Don't retry sending a report if it fails
This commit is contained in:
@@ -407,8 +407,6 @@ uint32_t UsbReportUpdateCounter;
|
|||||||
|
|
||||||
void UpdateUsbReports(void)
|
void UpdateUsbReports(void)
|
||||||
{
|
{
|
||||||
usb_status_t status;
|
|
||||||
|
|
||||||
if (UsbReportUpdateSemaphore) {
|
if (UsbReportUpdateSemaphore) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -433,31 +431,23 @@ void UpdateUsbReports(void)
|
|||||||
|
|
||||||
if (HasUsbBasicKeyboardReportChanged) {
|
if (HasUsbBasicKeyboardReportChanged) {
|
||||||
UsbReportUpdateSemaphore |= 1 << USB_BASIC_KEYBOARD_INTERFACE_INDEX;
|
UsbReportUpdateSemaphore |= 1 << USB_BASIC_KEYBOARD_INTERFACE_INDEX;
|
||||||
do {
|
UsbBasicKeyboardAction();
|
||||||
status = UsbBasicKeyboardAction();
|
|
||||||
} while (status != kStatus_USB_Success);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasUsbMediaKeyboardReportChanged) {
|
if (HasUsbMediaKeyboardReportChanged) {
|
||||||
UsbReportUpdateSemaphore |= 1 << USB_MEDIA_KEYBOARD_INTERFACE_INDEX;
|
UsbReportUpdateSemaphore |= 1 << USB_MEDIA_KEYBOARD_INTERFACE_INDEX;
|
||||||
do {
|
UsbMediaKeyboardAction();
|
||||||
status = UsbMediaKeyboardAction();
|
|
||||||
} while (status != kStatus_USB_Success);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasUsbSystemKeyboardReportChanged) {
|
if (HasUsbSystemKeyboardReportChanged) {
|
||||||
UsbReportUpdateSemaphore |= 1 << USB_SYSTEM_KEYBOARD_INTERFACE_INDEX;
|
UsbReportUpdateSemaphore |= 1 << USB_SYSTEM_KEYBOARD_INTERFACE_INDEX;
|
||||||
do {
|
UsbSystemKeyboardAction();
|
||||||
status = UsbSystemKeyboardAction();
|
|
||||||
} while (status != kStatus_USB_Success);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send out the mouse position and wheel values continuously if the report is not zeros, but only send the mouse button states when they change.
|
// Send out the mouse position and wheel values continuously if the report is not zeros, but only send the mouse button states when they change.
|
||||||
if (HasUsbMouseReportChanged || ActiveUsbMouseReport->x || ActiveUsbMouseReport->y ||
|
if (HasUsbMouseReportChanged || ActiveUsbMouseReport->x || ActiveUsbMouseReport->y ||
|
||||||
ActiveUsbMouseReport->wheelX || ActiveUsbMouseReport->wheelY) {
|
ActiveUsbMouseReport->wheelX || ActiveUsbMouseReport->wheelY) {
|
||||||
UsbReportUpdateSemaphore |= 1 << USB_MOUSE_INTERFACE_INDEX;
|
UsbReportUpdateSemaphore |= 1 << USB_MOUSE_INTERFACE_INDEX;
|
||||||
do {
|
UsbMouseAction();
|
||||||
status = UsbMouseAction();
|
|
||||||
} while (status != kStatus_USB_Success);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user