Skip to content
Open
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion subsys/shell/backends/shell_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ 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) {
while ((ring_buf_space_get(&sh_uart->rx_ringbuf) > 0) &&
(uart_poll_in(sh_uart->common.dev, &c) == 0)) {
if (ring_buf_put(&sh_uart->rx_ringbuf, &c, 1) == 0U) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the if statement still make sense to have it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it there just in case there was some possibility of concurrency in the shell thread… I'm still getting my head around the architecture that is Zephyr, but I can remove it if you think that'd be better.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in c14fdd5. :-)

/* ring buffer full. */
LOG_WRN("RX ring buffer full.");
Expand Down