summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx/lpc17_serial.c')
-rwxr-xr-xnuttx/arch/arm/src/lpc17xx/lpc17_serial.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c
index d58ce7c03..63687038f 100755
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c
@@ -664,13 +664,15 @@ static inline void lpc17_uart1config(uint32_t clkdiv)
lpc17_configgpio(GPIO_UART1_TXD);
lpc17_configgpio(GPIO_UART1_RXD);
-#ifdef CONFIG_UART0_FLOWCONTROL
+#ifdef CONFIG_UART1_FLOWCONTROL
lpc17_configgpio(GPIO_UART1_CTS);
+ lpc17_configgpio(GPIO_UART1_RTS);
lpc17_configgpio(GPIO_UART1_DCD);
lpc17_configgpio(GPIO_UART1_DSR);
lpc17_configgpio(GPIO_UART1_DTR);
+#ifdef CONFIG_UART1_RINGINDICATOR
lpc17_configgpio(GPIO_UART1_RI);
- lpc17_configgpio(GPIO_UART1_RTS);
+#endif
#endif
irqrestore(flags);
};
@@ -849,6 +851,16 @@ static int up_setup(struct uart_dev_s *dev)
up_serialout(priv, LPC17_UART_FCR_OFFSET,
(UART_FCR_RXTRIGGER_8|UART_FCR_TXRST|UART_FCR_RXRST|UART_FCR_FIFOEN));
+
+ /* Enable Auto-RTS and Auto-CS Flow Control in the Modem Control Register */
+
+#ifdef CONFIG_UART1_FLOWCONTROL
+ if (priv->uartbase == LPC17_UART1_BASE)
+ {
+ up_serialout(priv, LPC17_UART_MCR_OFFSET, (UART_MCR_RTSEN|UART_MCR_CTSEN));
+ }
+#endif
+
#endif
return OK;
}