Browse Source

Check for ongoing transfers on the OUT endpoint (#16974)

...when attempting to start a receiving USB transfer. Previously, we would
check on the IN endpoint which is the transmitting part of the USB endpoint.
This is wrong and lead to two USB transfers being started immediately
after each other in case of e.g. RAW HID endpoints:

1. When finishing an OUT transfer the low level USB driver calls the out_cb
callback, which in turn initiates another OUT transfer by calling
qmkusbDataReceived.

2. When the raw hid receive channel runs empty inside the raw_hid task,
another OUT transfer is started to potentially fill the channel again. This
happens by calling ibnotify.

Both events occur directly after each other, thus triggering the bug.
pull/17099/head
Stefan Kerkmann 1 year ago
committed by GitHub
parent
commit
4d107feca9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      tmk_core/protocol/chibios/usb_driver.c

+ 1
- 1
tmk_core/protocol/chibios/usb_driver.c View File

@ -60,7 +60,7 @@ static bool qmkusb_start_receive(QMKUSBDriver *qmkusbp) {
}
/* Checking if there is already a transaction ongoing on the endpoint.*/
if (usbGetReceiveStatusI(qmkusbp->config->usbp, qmkusbp->config->bulk_in)) {
if (usbGetReceiveStatusI(qmkusbp->config->usbp, qmkusbp->config->bulk_out)) {
return true;
}


Loading…
Cancel
Save