altos/lpc: Validate UART pin config
authorKeith Packard <keithp@keithp.com>
Tue, 28 Mar 2023 18:56:27 +0000 (11:56 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 28 Mar 2023 18:56:27 +0000 (11:56 -0700)
Make sure some UART pin configuration has been selected

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lpc/ao_serial_lpc.c

index 1a833b3860d22d3268a772124dd01cff5ddbf016..2362c67421774f77a73b08c63afc8d5ee5147f36 100644 (file)
@@ -156,8 +156,7 @@ ao_serial_init(void)
                              (0 << LPC_IOCONF_HYS) |
                              (0 << LPC_IOCONF_INV) |
                              (0 << LPC_IOCONF_OD));
-#endif
-#if SERIAL_1_13_14
+#elif SERIAL_1_13_14
        lpc_ioconf.pio1_13 = ((LPC_IOCONF_FUNC_PIO1_13_TXD << LPC_IOCONF_FUNC) |
                              (LPC_IOCONF_MODE_INACTIVE << LPC_IOCONF_MODE) |
                              (0 << LPC_IOCONF_HYS) |
@@ -168,6 +167,8 @@ ao_serial_init(void)
                              (0 << LPC_IOCONF_HYS) |
                              (0 << LPC_IOCONF_INV) |
                              (0 << LPC_IOCONF_OD));
+#else
+#error No serial pin configuration selected
 #endif
 
        /* Turn on the USART */