diff options
| -rw-r--r-- | tmk_core/protocol/chibios/usb_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 9b139b399..3b16a0ff7 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c | |||
| @@ -934,6 +934,17 @@ static void send_extra(uint8_t report_id, uint16_t data) { | |||
| 934 | return; | 934 | return; |
| 935 | } | 935 | } |
| 936 | 936 | ||
| 937 | if (usbGetTransmitStatusI(&USB_DRIVER, SHARED_IN_EPNUM)) { | ||
| 938 | /* Need to either suspend, or loop and call unlock/lock during | ||
| 939 | * every iteration - otherwise the system will remain locked, | ||
| 940 | * no interrupts served, so USB not going through as well. | ||
| 941 | * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ | ||
| 942 | if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[SHARED_IN_EPNUM]->in_state->thread, TIME_MS2I(10)) == MSG_TIMEOUT) { | ||
| 943 | osalSysUnlock(); | ||
| 944 | return; | ||
| 945 | } | ||
| 946 | } | ||
| 947 | |||
| 937 | static report_extra_t report; | 948 | static report_extra_t report; |
| 938 | report = (report_extra_t){.report_id = report_id, .usage = data}; | 949 | report = (report_extra_t){.report_id = report_id, .usage = data}; |
| 939 | 950 | ||
