public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] debug_uart: output CR along with LF
@ 2016-03-08  9:19 Masahiro Yamada
  2016-03-08  9:24 ` Stefan Roese
  2016-03-08 23:33 ` Simon Glass
  0 siblings, 2 replies; 12+ messages in thread
From: Masahiro Yamada @ 2016-03-08  9:19 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Masahiro Yamada <yamada.masahiro@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

^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [U-Boot] [PATCH] debug_uart: output CR along with LF
@ 2016-04-04 15:16 Tim Chick
  2016-04-07 15:34 ` Masahiro Yamada
  2016-04-07 16:48 ` Daniel Schwierzeck
  0 siblings, 2 replies; 12+ messages in thread
From: Tim Chick @ 2016-04-04 15:16 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

This patch breaks the debug_uart on my MIPS board. It means printascii now uses the stack, and my board does not have a stack when debug_uart_init is called. debug_uart_init calls printascii if DEBUG_UART_ANNOUNCE is defined.

The patch below fixes it, and keeps your change:

Thanks,
Tim


---

diff --git a/include/debug_uart.h b/include/debug_uart.h
index 0d640b9..2980ae6 100644
--- a/include/debug_uart.h
+++ b/include/debug_uart.h
@@ -115,17 +115,23 @@ void printhex8(uint value);
  * Now define some functions - this should be inserted into the serial driver
  */
 #define DEBUG_UART_FUNCS \
-	void printch(int ch) \
+\
+	static inline void _printch(int ch) \
 	{ \
 		if (ch == '\n') \
 			_debug_uart_putc('\r'); \
 		_debug_uart_putc(ch); \
 	} \
 \
+	void printch(int ch) \
+	{ \
+		_printch(ch); \
+	} \
+\
 	void printascii(const char *str) \
 	{ \
 		while (*str) \
-			printch(*str++); \
+			_printch(*str++); \
 	} \
 \
 	static inline void printhex1(uint digit) \

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-04-22 18:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08  9:19 [U-Boot] [PATCH] debug_uart: output CR along with LF Masahiro Yamada
2016-03-08  9:24 ` Stefan Roese
2016-03-08 23:33 ` Simon Glass
2016-03-13  1:51   ` Simon Glass
  -- strict thread matches above, loose matches on Subject: below --
2016-04-04 15:16 Tim Chick
2016-04-07 15:34 ` Masahiro Yamada
2016-04-07 17:18   ` Tim Chick
2016-04-07 16:48 ` Daniel Schwierzeck
2016-04-07 17:20   ` Tim Chick
2016-04-20 14:40     ` Simon Glass
2016-04-22 18:19       ` Tim Chick
2016-04-22 18:30         ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox