bsps/shared/zynq-uart-polled: fix bug in zynq_uart_initialize()

Similar to the recent commit in tms570-sci.c, the assumption that a UART will
only see printable ASCII characters, instead of any value in the range
0x00-0xFF, is wrong.

A non forgiving binary protocol will be thrown off by this driver sending
"\r\r\r\r" when initializing.

If a user wants to flush the interface, they should explicitely use the
dedicated function `tcflush(fd, TCIOFLUSH);`.
This commit is contained in:
Adrien Chardon
2024-01-30 18:02:04 +01:00
committed by Sebastian Huber
parent 333a1aee2b
commit 7be49773c0

View File

@@ -151,12 +151,6 @@ void zynq_uart_initialize(volatile zynq_uart *regs)
| ZYNQ_UART_MODE_PAR(ZYNQ_UART_MODE_PAR_NONE)
| ZYNQ_UART_MODE_CHRL(ZYNQ_UART_MODE_CHRL_8)
| mode_clks;
while (zynq_uart_read_char_polled(regs) >= 0) {
/* Drop */
}
zynq_uart_reset_tx_flush(regs);
}
int zynq_uart_read_char_polled(volatile zynq_uart *regs)