Browse Source

Format code according to conventions (#12540)

Co-authored-by: QMK Bot <hello@qmk.fm>
pull/12545/head 0.12.34
github-actions[bot] 3 years ago
committed by GitHub
parent
commit
7daa2e210c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      tmk_core/protocol/chibios/usb_driver.c

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

@ -81,17 +81,17 @@ static bool qmkusb_start_receive(QMKUSBDriver *qmkusbp) {
*/
static size_t _write(void *ip, const uint8_t *bp, size_t n) {
output_buffers_queue_t *obqueue = &((QMKUSBDriver *)ip)->obqueue;
chSysLock();
const bool full = obqIsFullI(obqueue);
chSysUnlock();
if (full || bqIsSuspendedX(obqueue)) {
/* Discard any writes while the queue is suspended or full, i.e. the hidraw
interface is not open. If we tried to send with an infinite timeout, we
would deadlock the keyboard otherwise. */
return -1;
}
return obqWriteTimeout(obqueue, bp, n, TIME_INFINITE);
output_buffers_queue_t *obqueue = &((QMKUSBDriver *)ip)->obqueue;
chSysLock();
const bool full = obqIsFullI(obqueue);
chSysUnlock();
if (full || bqIsSuspendedX(obqueue)) {
/* Discard any writes while the queue is suspended or full, i.e. the hidraw
interface is not open. If we tried to send with an infinite timeout, we
would deadlock the keyboard otherwise. */
return -1;
}
return obqWriteTimeout(obqueue, bp, n, TIME_INFINITE);
}
static size_t _read(void *ip, uint8_t *bp, size_t n) { return ibqReadTimeout(&((QMKUSBDriver *)ip)->ibqueue, bp, n, TIME_INFINITE); }


Loading…
Cancel
Save