Skip to content

Commit

Permalink
[Core] Serial-protocol: always clear receive queue on main half of sp…
Browse files Browse the repository at this point in the history
…lit keyboard (qmk#18419)
  • Loading branch information
KarlK90 committed Oct 3, 2022
1 parent ca0c128 commit 6bbcabe
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions platforms/chibios/drivers/serial_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,11 @@ static inline bool react_to_transaction(void) {
* @return bool Indicates success of transaction.
*/
bool soft_serial_transaction(int index) {
bool result = initiate_transaction((uint8_t)index);
/* Clear the receive queue, to start with a clean slate.
* Parts of failed transactions or spurious bytes could still be in it. */
serial_transport_driver_clear();

if (unlikely(!result)) {
/* Clear the receive queue, to start with a clean slate.
* Parts of failed transactions or spurious bytes could still be in it. */
serial_transport_driver_clear();
}

return result;
return initiate_transaction((uint8_t)index);
}

/**
Expand Down

0 comments on commit 6bbcabe

Please sign in to comment.