[Core] Serial-protocol: always clear receive queue on main half of split keyboard (#18419)

This commit is contained in:
Stefan Kerkmann 2022-10-03 18:23:45 +02:00 committed by GitHub
parent ca0c12847a
commit 6bbcabe0cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -102,15 +102,11 @@ static inline bool react_to_transaction(void) {
* @return bool Indicates success of transaction. * @return bool Indicates success of transaction.
*/ */
bool soft_serial_transaction(int index) { 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)) { return 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();
}
return result;
} }
/** /**