summaryrefslogtreecommitdiffstats
path: root/platforms/chibios
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2022-10-03 18:23:45 +0200
committerGitHub <noreply@github.com>2022-10-03 18:23:45 +0200
commit6bbcabe0ccf7087c9754ebc17e4bded4d322eaa3 (patch)
tree29cf1dfe2be28fa2f5ba6122d9fea88469b8fb21 /platforms/chibios
parentca0c12847a97a62f887fd4625673395104a7257b (diff)
[Core] Serial-protocol: always clear receive queue on main half of split keyboard (#18419)
Diffstat (limited to 'platforms/chibios')
-rw-r--r--platforms/chibios/drivers/serial_protocol.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/platforms/chibios/drivers/serial_protocol.c b/platforms/chibios/drivers/serial_protocol.c
index c95aed9885..ccaf73282d 100644
--- a/platforms/chibios/drivers/serial_protocol.c
+++ b/platforms/chibios/drivers/serial_protocol.c
@@ -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);
}
/**