diff mbox

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

Message ID 1457428750-28757-1-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit b391d743363247bf502fb0b5ca098246ea5a1512
Delegated to: Simon Glass
Headers show

Commit Message

Masahiro Yamada March 8, 2016, 9:19 a.m. UTC
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(-)

Comments

Stefan Roese March 8, 2016, 9:24 a.m. UTC | #1
On 08.03.2016 10:19, Masahiro Yamada wrote:
> 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>

Yes, this has bugged me as well a few times as well. Thanks!

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
Simon Glass March 8, 2016, 11:33 p.m. UTC | #2
On 8 March 2016 at 02:19, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
> 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(-)


Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass March 13, 2016, 1:51 a.m. UTC | #3
On 8 March 2016 at 16:33, Simon Glass <sjg@chromium.org> wrote:
> On 8 March 2016 at 02:19, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>>
>> 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(-)
>
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm/next, thanks!
diff mbox

Patch

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) \