瀏覽代碼

Revert "Revert "stm32f4: fix serial output""

Due to a misunderstanding, in 698a12b we reverted changes that we in
fact wanted to keep.  So lets fix that mistake and bring the code back
to how it should have been.

This reverts commit 698a12bef9e782dcd99c555a739c16eec8669f14.

Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini 10 年之前
父節點
當前提交
445614cc2f
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/serial/serial_stm32.c

+ 3 - 0
drivers/serial/serial_stm32.c

@@ -128,6 +128,9 @@ static void stm32_serial_putc(const char c)
 	struct stm32_serial *usart =
 		(struct stm32_serial *)usart_base[USART_PORT];
 
+	if (c == '\n')
+		stm32_serial_putc('\r');
+
 	while ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
 		;
 	writel(c, &usart->dr);