xiaoxiang781216 commented on a change in pull request #5363: URL: https://github.com/apache/incubator-nuttx/pull/5363#discussion_r801378995
########## File path: arch/arm/src/phy62xx/uart.c ########## @@ -921,11 +941,21 @@ static void pplus_uart_rxint(struct uart_dev_s *dev, bool enable) static bool pplus_uart_rxavailable(struct uart_dev_s *dev) { + static int len_fifo; uart_Ctx_t *priv = (uart_Ctx_t *)dev->priv; - - /* Return true if the receive buffer/fifo is not "empty." */ - - return priv->rx_available; + /* Detect the length of received data from fifo*/ + if(len_fifo == 0) + { + hal_UART0_IRQHandler(); + len_fifo = fifo_len_store; + } + if(len_fifo <= 0) + { + len_fifo = 0; + return len_fifo; + } + else + return len_fifo--; Review comment: but the format is obviously wrong, please read the guide: https://nuttx.apache.org/docs/latest/contributing/coding_style.html -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org