Closed
Description
According to @jasoroony's comments and after checking the doc, it appears that:
inline size_t uart_rx_fifo_available(uart_t* uart) {
return (USS(uart->uart_nr) >> USRXC) & 0x7F;
}
should be:
inline size_t uart_rx_fifo_available(uart_t* uart) {
return (USS(uart->uart_nr) >> USRXC) & 0xFF;
}
reference section 11.3.7:
Rx fifo length:
(READ_PERI_REG(UART_STATUS(UART0))>>UART_RXFIFO_CNT_S)&UART_RXFIFO_CNT;
where
tools/sdk/include/uart_register.h:#define UART_RXFIFO_CNT 0x000000FF
(both USRXC
and UART_RXFIFO_CNT_S
are 0)
Metadata
Metadata
Assignees
Labels
No labels