From fee8b0cf208ee8973f062b8b258918d18a15a378 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 10 Aug 2013 19:33:16 -0600 Subject: STM32: Fix STM32 serial init for non-reordered serial ports. From Lorenz Meier --- nuttx/arch/arm/src/stm32/stm32_serial.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c index 037ad07db..3cbcd6a92 100644 --- a/nuttx/arch/arm/src/stm32/stm32_serial.c +++ b/nuttx/arch/arm/src/stm32/stm32_serial.c @@ -2441,10 +2441,17 @@ void up_serialinit(void) for (i = 0; i < STM32_NUSART; i++) { + /* Don't create a device for non-configured ports. */ + + if (uart_devs[i] == 0) + { + continue; + } + #ifndef CONFIG_SERIAL_DISABLE_REORDERING /* Don't create a device for the console - we did that above */ - if ((uart_devs[i] == 0) || (uart_devs[i]->dev.isconsole)) + if (uart_devs[i]->dev.isconsole) { continue; } -- cgit v1.2.3