From 24f8fd53abeb05cc8596ff569d2730cb315ee413 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 2 Jan 2015 14:05:42 -0600 Subject: [PATCH] Tiva serial: Add volatile to fix a wait loop that was not waiting; CR really should preced LF in CR-LF expansion --- arch/arm/src/tiva/tiva_serial.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/tiva/tiva_serial.c b/arch/arm/src/tiva/tiva_serial.c index a84e71763cc..8fd78cf5e96 100644 --- a/arch/arm/src/tiva/tiva_serial.c +++ b/arch/arm/src/tiva/tiva_serial.c @@ -685,7 +685,7 @@ static inline void up_restoreuartint(struct up_dev_s *priv, uint32_t im) #ifdef HAVE_SERIAL_CONSOLE static inline void up_waittxnotfull(struct up_dev_s *priv) { - int tmp; + volatile int tmp; /* Limit how long we will wait for the TX available condition */ @@ -1355,8 +1355,6 @@ int up_putc(int ch) uint32_t im; up_disableuartint(priv, &im); - up_waittxnotfull(priv); - up_serialout(priv, TIVA_UART_DR_OFFSET, (uint32_t)ch); /* Check for LF */ @@ -1368,6 +1366,9 @@ int up_putc(int ch) up_serialout(priv, TIVA_UART_DR_OFFSET, (uint32_t)'\r'); } + up_waittxnotfull(priv); + up_serialout(priv, TIVA_UART_DR_OFFSET, (uint32_t)ch); + up_waittxnotfull(priv); up_restoreuartint(priv, im); #endif