forked from Imagelibrary/rtems
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:
committed by
Sebastian Huber
parent
333a1aee2b
commit
7be49773c0
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user