Skip to content

Commit

Permalink
Format code according to conventions (qmk#12540)
Browse files Browse the repository at this point in the history
Co-authored-by: QMK Bot <[email protected]>
  • Loading branch information
github-actions[bot] and qmk-bot authored Apr 10, 2021
1 parent 7d95333 commit 7daa2e2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tmk_core/protocol/chibios/usb_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down

0 comments on commit 7daa2e2

Please sign in to comment.