Skip to content

uart_rx_fifo_available considerations #4565

Closed
@d-a-v

Description

@d-a-v

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions