[Bug] RP2040: only clear RX FIFO for serial pio driver clear (#18581)

This commit is contained in:
Stefan Kerkmann 2022-10-04 20:56:40 +02:00 committed by GitHub
parent 56f7b34289
commit b6ea8837e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -181,12 +181,13 @@ static inline void leave_rx_state(void) {}
#endif
/**
* @brief Clear the RX and TX hardware FIFOs of the state machines.
* @brief Clear the FIFO of the RX state machine.
*/
inline void serial_transport_driver_clear(void) {
osalSysLock();
pio_sm_clear_fifos(pio, rx_state_machine);
pio_sm_clear_fifos(pio, tx_state_machine);
while (!pio_sm_is_rx_fifo_empty(pio, rx_state_machine)) {
pio_sm_clear_fifos(pio, rx_state_machine);
}
osalSysUnlock();
}