[U-Boot] [PATCH] debug_uart: output CR along with LF

Masahiro Yamada yamada.masahiro at socionext.com
Tue Mar 8 10:19:10 CET 2016


The serial output from the debug UART carries on going far to the
right in the console.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

 include/debug_uart.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/debug_uart.h b/include/debug_uart.h
index 5d5349b..0d640b9 100644
--- a/include/debug_uart.h
+++ b/include/debug_uart.h
@@ -117,13 +117,15 @@ void printhex8(uint value);
 #define DEBUG_UART_FUNCS \
 	void printch(int ch) \
 	{ \
+		if (ch == '\n') \
+			_debug_uart_putc('\r'); \
 		_debug_uart_putc(ch); \
 	} \
 \
 	void printascii(const char *str) \
 	{ \
 		while (*str) \
-			_debug_uart_putc(*str++); \
+			printch(*str++); \
 	} \
 \
 	static inline void printhex1(uint digit) \
-- 
1.9.1



More information about the U-Boot mailing list