From 6948fc437addf2af8c262deebcbcf38cb7b972fc Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Tue, 2 Feb 2016 12:21:34 +0200 Subject: [PATCH] uart-pipe: Fix using fifo_fill instead of poll_out For non-interrupt transfers poll_out should be used, This fixes data lost issues on a real UART hardware like Arduino 101 and Galileo boards. Change-Id: Ic7a5d055941d83f9d62cbea9e911ce25730ed7b6 Signed-off-by: Andrei Emeltchenko --- drivers/console/uart_pipe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/console/uart_pipe.c b/drivers/console/uart_pipe.c index 0c713972641..f56f9b147f8 100644 --- a/drivers/console/uart_pipe.c +++ b/drivers/console/uart_pipe.c @@ -65,11 +65,11 @@ void uart_pipe_isr(void *unused) int uart_pipe_send(const uint8_t *data, int len) { - if (uart_pipe_dev != NULL) { - return uart_fifo_fill(uart_pipe_dev, data, len); - } else { - return 0; + while (len--) { + uart_poll_out(uart_pipe_dev, *data++); } + + return 0; } static void uart_pipe_setup(struct device *uart)