]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32f4: fix serial output
authorkunhuahuang <huangkunhua@gmail.com>
Mon, 27 Apr 2015 18:25:45 +0000 (02:25 +0800)
committerTom Rini <trini@konsulko.com>
Sun, 10 May 2015 11:29:38 +0000 (07:29 -0400)
This patch fix the serial output.
The source is from Kamil Lulko's "stm32f429-discovery board support"

Thanks, Varcain. I learned a lot.

Signed-off-by: kunhuahuang <huangkunhua@gmail.com>
drivers/serial/serial_stm32.c

index 3c800961d1affb49bb23154e877ea4e4efb0dfca..8c613db95d5875a752e92ecbb7e7f3946eec1b79 100644 (file)
@@ -81,6 +81,10 @@ static int stm32_serial_getc(void)
 static void stm32_serial_putc(const char c)
 {
        struct stm32_serial *usart = (struct stm32_serial *)USART_BASE;
+
+       if (c == '\n')
+               stm32_serial_putc('\r');
+
        while ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
                ;
        writel(c, &usart->dr);