Skip to content

Commit 88f838b

Browse files
michal-smolanashif
authored andcommitted
drivers: uart: Fix build error for lpuart without modem support
LPUART without modem support is used in some NXP socs. Build error occurs for such socs because of accessing unavailable register. Fix it by adding #if directive for checking modem support availability. Signed-off-by: Michal Smola <[email protected]>
1 parent ecf6e34 commit 88f838b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/serial/uart_mcux_lpuart.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,13 +1092,17 @@ static int mcux_lpuart_configure_init(const struct device *dev, const struct uar
10921092

10931093
LPUART_Init(config->base, &uart_config, clock_freq);
10941094

1095+
#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && \
1096+
FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT
10951097
if (cfg->flow_ctrl == UART_CFG_FLOW_CTRL_RS485) {
10961098
/* Set the LPUART into RS485 mode (tx driver enable using RTS) */
10971099
config->base->MODIR |= LPUART_MODIR_TXRTSE(true);
10981100
if (!config->rs485_de_active_low) {
10991101
config->base->MODIR |= LPUART_MODIR_TXRTSPOL(1);
11001102
}
11011103
}
1104+
#endif
1105+
11021106
/* Now can enable tx */
11031107
config->base->CTRL |= LPUART_CTRL_TE(true);
11041108

0 commit comments

Comments
 (0)