diff --git a/arch/arm/src/imxrt/imxrt_serial.c b/arch/arm/src/imxrt/imxrt_serial.c index 301e647a44..e95ae4f4a2 100644 --- a/arch/arm/src/imxrt/imxrt_serial.c +++ b/arch/arm/src/imxrt/imxrt_serial.c @@ -1578,15 +1578,15 @@ static int imxrt_setup(struct uart_dev_s *dev) config.parity = priv->parity; /* 0=none, 1=odd, 2=even */ config.bits = priv->bits; /* Number of bits (5-9) */ config.stopbits2 = priv->stopbits2; /* true: Configure with 2 stop bits instead of 1 */ -#ifdef CONFIG_SERIAL_IFLOWCONTROL - config.usects = priv->iflow; /* Flow control on inbound side */ -#endif #ifdef CONFIG_SERIAL_OFLOWCONTROL - /* Flow control on outbound side if not GPIO based */ + config.usects = priv->oflow; /* Flow control on outbound side */ +#endif +#ifdef CONFIG_SERIAL_IFLOWCONTROL + /* Flow control on inbound side if not GPIO based */ if ((priv->rts_gpio & GPIO_MODE_MASK) == GPIO_PERIPH) { - config.userts = priv->oflow; + config.userts = priv->iflow; } #endif