diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-02-19 17:02:30 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-02-19 17:02:30 -0600 |
commit | 59cc45b5ffaa99de068f19ddafa625f8f77deed9 (patch) | |
tree | 7c37195713eaa0cd3752c3b7462389cd7d2f28b2 | |
parent | e88925ec0969724cfb854aa7bb75508866c0778c (diff) | |
download | nuttx-59cc45b5ffaa99de068f19ddafa625f8f77deed9.tar.gz nuttx-59cc45b5ffaa99de068f19ddafa625f8f77deed9.tar.bz2 nuttx-59cc45b5ffaa99de068f19ddafa625f8f77deed9.zip |
LM3/4: Several errors were unmasked with UARTs > UART2 were enabled. Fromo Gosha
-rw-r--r-- | nuttx/ChangeLog | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/lm/lm_lowputc.c | 13 | ||||
-rw-r--r-- | nuttx/arch/arm/src/lm/lm_serial.c | 43 |
3 files changed, 50 insertions, 8 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 33f004ba5..3e6236588 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -6624,4 +6624,6 @@ * arch/arm/src/samd/sam_spi.c: Add framework for a SAMD SPI driver. The initial check-in is a crude port of the SAMA5 SPI driver with a lot of missing logic (2014-2-19). + * arch/arm/src/lm/lm_lowputc.c and lm_serial.c: Several errors + are unmasked with UARTs > UART2 are enabled. From gosha (2014-2-19). diff --git a/nuttx/arch/arm/src/lm/lm_lowputc.c b/nuttx/arch/arm/src/lm/lm_lowputc.c index ce822538f..6bb803314 100644 --- a/nuttx/arch/arm/src/lm/lm_lowputc.c +++ b/nuttx/arch/arm/src/lm/lm_lowputc.c @@ -77,31 +77,31 @@ # define LM_CONSOLE_PARITY CONFIG_UART2_PARITY # define LM_CONSOLE_2STOP CONFIG_UART2_2STOP #elif defined(CONFIG_UART3_SERIAL_CONSOLE) -# define LM_CONSOLE_BASE LM_UART2_BASE +# define LM_CONSOLE_BASE LM_UART3_BASE # define LM_CONSOLE_BAUD CONFIG_UART3_BAUD # define LM_CONSOLE_BITS CONFIG_UART3_BITS # define LM_CONSOLE_PARITY CONFIG_UART3_PARITY # define LM_CONSOLE_2STOP CONFIG_UART3_2STOP #elif defined(CONFIG_UART4_SERIAL_CONSOLE) -# define LM_CONSOLE_BASE LM_UART2_BASE +# define LM_CONSOLE_BASE LM_UART4_BASE # define LM_CONSOLE_BAUD CONFIG_UART4_BAUD # define LM_CONSOLE_BITS CONFIG_UART4_BITS # define LM_CONSOLE_PARITY CONFIG_UART4_PARITY # define LM_CONSOLE_2STOP CONFIG_UART4_2STOP #elif defined(CONFIG_UART5_SERIAL_CONSOLE) -# define LM_CONSOLE_BASE LM_UART2_BASE +# define LM_CONSOLE_BASE LM_UART5_BASE # define LM_CONSOLE_BAUD CONFIG_UART5_BAUD # define LM_CONSOLE_BITS CONFIG_UART5_BITS # define LM_CONSOLE_PARITY CONFIG_UART5_PARITY # define LM_CONSOLE_2STOP CONFIG_UART5_2STOP #elif defined(CONFIG_UART6_SERIAL_CONSOLE) -# define LM_CONSOLE_BASE LM_UART2_BASE +# define LM_CONSOLE_BASE LM_UART6_BASE # define LM_CONSOLE_BAUD CONFIG_UART6_BAUD # define LM_CONSOLE_BITS CONFIG_UART6_BITS # define LM_CONSOLE_PARITY CONFIG_UART6_PARITY # define LM_CONSOLE_2STOP CONFIG_UART6_2STOP #elif defined(CONFIG_UART7_SERIAL_CONSOLE) -# define LM_CONSOLE_BASE LM_UART2_BASE +# define LM_CONSOLE_BASE LM_UART7_BASE # define LM_CONSOLE_BAUD CONFIG_UART7_BAUD # define LM_CONSOLE_BITS CONFIG_UART7_BITS # define LM_CONSOLE_PARITY CONFIG_UART7_PARITY @@ -354,7 +354,4 @@ void up_lowsetup(void) ctl |= (UART_CTL_UARTEN|UART_CTL_TXE|UART_CTL_RXE); putreg32(ctl, LM_CONSOLE_BASE+LM_UART_CTL_OFFSET); #endif - } - - diff --git a/nuttx/arch/arm/src/lm/lm_serial.c b/nuttx/arch/arm/src/lm/lm_serial.c index 52773608e..61999d45a 100644 --- a/nuttx/arch/arm/src/lm/lm_serial.c +++ b/nuttx/arch/arm/src/lm/lm_serial.c @@ -961,9 +961,52 @@ static int up_interrupt(int irq, void *context) } else #endif +#ifdef CONFIG_LM_UART2 + if (g_uart2priv.irq == irq) + { + dev = &g_uart2port; + } + else +#endif +#ifdef CONFIG_LM_UART3 + if (g_uart3priv.irq == irq) + { + dev = &g_uart3port; + } + else +#endif +#ifdef CONFIG_LM_UART4 + if (g_uart4priv.irq == irq) + { + dev = &g_uart4port; + } + else +#endif +#ifdef CONFIG_LM_UART5 + if (g_uart5priv.irq == irq) + { + dev = &g_uart5port; + } + else +#endif +#ifdef CONFIG_LM_UART6 + if (g_uart6priv.irq == irq) + { + dev = &g_uart6port; + } + else +#endif +#ifdef CONFIG_LM_UART7 + if (g_uart7priv.irq == irq) + { + dev = &g_uart7port; + } + else +#endif { PANIC(); } + priv = (struct up_dev_s*)dev->priv; /* Loop until there are no characters to be transferred or, |