diff options
| author | QMK Bot <hello@qmk.fm> | 2021-04-10 16:34:58 +0000 |
|---|---|---|
| committer | QMK Bot <hello@qmk.fm> | 2021-04-10 16:34:58 +0000 |
| commit | 34323ecd8b4daa37723d662e2af84a6b81f3d618 (patch) | |
| tree | 9dac9aca569477c09855df2309b4fd17d5b9f8b5 | |
| parent | d5a8431af4fa3f64c457eca467ce3e969a08292b (diff) | |
| parent | 7daa2e210cc7fc121259535d724962c9896c5f3a (diff) | |
| download | qmk_firmware-34323ecd8b4daa37723d662e2af84a6b81f3d618.tar.gz qmk_firmware-34323ecd8b4daa37723d662e2af84a6b81f3d618.zip | |
Merge remote-tracking branch 'origin/master' into develop
| -rw-r--r-- | tmk_core/protocol/chibios/usb_driver.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tmk_core/protocol/chibios/usb_driver.c b/tmk_core/protocol/chibios/usb_driver.c index eb72f8ff6..40bfb8eb2 100644 --- a/tmk_core/protocol/chibios/usb_driver.c +++ b/tmk_core/protocol/chibios/usb_driver.c | |||
| @@ -81,17 +81,17 @@ static bool qmkusb_start_receive(QMKUSBDriver *qmkusbp) { | |||
| 81 | */ | 81 | */ |
| 82 | 82 | ||
| 83 | static size_t _write(void *ip, const uint8_t *bp, size_t n) { | 83 | static size_t _write(void *ip, const uint8_t *bp, size_t n) { |
| 84 | output_buffers_queue_t *obqueue = &((QMKUSBDriver *)ip)->obqueue; | 84 | output_buffers_queue_t *obqueue = &((QMKUSBDriver *)ip)->obqueue; |
| 85 | chSysLock(); | 85 | chSysLock(); |
| 86 | const bool full = obqIsFullI(obqueue); | 86 | const bool full = obqIsFullI(obqueue); |
| 87 | chSysUnlock(); | 87 | chSysUnlock(); |
| 88 | if (full || bqIsSuspendedX(obqueue)) { | 88 | if (full || bqIsSuspendedX(obqueue)) { |
| 89 | /* Discard any writes while the queue is suspended or full, i.e. the hidraw | 89 | /* Discard any writes while the queue is suspended or full, i.e. the hidraw |
| 90 | interface is not open. If we tried to send with an infinite timeout, we | 90 | interface is not open. If we tried to send with an infinite timeout, we |
| 91 | would deadlock the keyboard otherwise. */ | 91 | would deadlock the keyboard otherwise. */ |
| 92 | return -1; | 92 | return -1; |
| 93 | } | 93 | } |
| 94 | return obqWriteTimeout(obqueue, bp, n, TIME_INFINITE); | 94 | return obqWriteTimeout(obqueue, bp, n, TIME_INFINITE); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | static size_t _read(void *ip, uint8_t *bp, size_t n) { return ibqReadTimeout(&((QMKUSBDriver *)ip)->ibqueue, bp, n, TIME_INFINITE); } | 97 | static size_t _read(void *ip, uint8_t *bp, size_t n) { return ibqReadTimeout(&((QMKUSBDriver *)ip)->ibqueue, bp, n, TIME_INFINITE); } |
