Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions subsys/shell/backends/shell_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,9 @@ static void polling_rx_timeout_handler(struct k_timer *timer)
uint8_t c;
struct shell_uart_polling *sh_uart = k_timer_user_data_get(timer);

while (uart_poll_in(sh_uart->common.dev, &c) == 0) {
if (ring_buf_put(&sh_uart->rx_ringbuf, &c, 1) == 0U) {
/* ring buffer full. */
LOG_WRN("RX ring buffer full.");
}
while ((ring_buf_space_get(&sh_uart->rx_ringbuf) > 0) &&
(uart_poll_in(sh_uart->common.dev, &c) == 0)) {
ring_buf_put(&sh_uart->rx_ringbuf, &c, 1);
sh_uart->common.handler(SHELL_TRANSPORT_EVT_RX_RDY, sh_uart->common.context);
}
}
Expand Down