stm32l: fix new line output on the UART

On the STM32L UART without a FIFO, the Transmit Register might need
some time before pushing its content to the shift register.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=on ADV board, verify we are no longer missing most of the carriage
return on console.

Change-Id: Ic638dc452d6e30a5f127710fc964143d477fa1d6
This commit is contained in:
Vincent Palatin
2012-02-23 14:39:30 -08:00
parent e3fbea00b7
commit 9ecf232dbd

View File

@@ -59,6 +59,11 @@ int uart_rx_available(void)
void uart_write_char(char c)
{
/* we normally never wait here since uart_write_char is normally called
* when the buffer is ready, excepted when we insert a carriage return
* before a line feed in the interrupt routine.
*/
while (!uart_tx_ready()) ;
STM32L_USART_DR(UARTN) = c;
}