Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unreliable multimedia keys on Planck rev 6.1/Proton-C #13959

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tmk_core/protocol/chibios/usb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,15 @@ static void send_extra(uint8_t report_id, uint16_t data) {
return;
}

if (usbGetTransmitStatusI(&USB_DRIVER, SHARED_IN_EPNUM)) {
/* This was copied from send_mouse and fixed my very unreliable
* multimedia keys (which would register only every 100th or so time). */
if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[SHARED_IN_EPNUM]->in_state->thread, TIME_MS2I(10)) == MSG_TIMEOUT) {
osalSysUnlock();
return;
}
}

static report_extra_t report;
report = (report_extra_t){.report_id = report_id, .usage = data};

Expand Down