summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-02 14:05:42 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-02 14:05:42 -0600
commitedb53c7ea434cce32a19adb289cf06bec7ecc4e0 (patch)
tree29a04ee59d978494cfc3f434fef65fb9e3605955
parent8f7b45e9e8e348fbba2d758fab3e0720790bc970 (diff)
downloadnuttx-edb53c7ea434cce32a19adb289cf06bec7ecc4e0.tar.gz
nuttx-edb53c7ea434cce32a19adb289cf06bec7ecc4e0.tar.bz2
nuttx-edb53c7ea434cce32a19adb289cf06bec7ecc4e0.zip
Tiva serial: Add volatile to fix a wait loop that was not waiting; CR really should preced LF in CR-LF expansion
-rw-r--r--nuttx/arch/arm/src/tiva/tiva_serial.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/tiva/tiva_serial.c b/nuttx/arch/arm/src/tiva/tiva_serial.c
index a84e71763..8fd78cf5e 100644
--- a/nuttx/arch/arm/src/tiva/tiva_serial.c
+++ b/nuttx/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 */
@@ -1369,6 +1367,9 @@ int up_putc(int ch)
}
up_waittxnotfull(priv);
+ up_serialout(priv, TIVA_UART_DR_OFFSET, (uint32_t)ch);
+
+ up_waittxnotfull(priv);
up_restoreuartint(priv, im);
#endif
return ch;