diff --git a/src/ext/serial.cpp b/src/ext/serial.cpp index a093dfb..c7c6fbc 100644 --- a/src/ext/serial.cpp +++ b/src/ext/serial.cpp @@ -17,7 +17,14 @@ #include "hardware.h" #include "data_nodes.h" +#if CONFIG_UEXT_SERIAL_THINGSET +#define UART_DEVICE_NAME DT_LABEL(DT_ALIAS(uart_uext)) +#elif DT_NODE_EXISTS(DT_ALIAS(uart_dbg)) #define UART_DEVICE_NAME DT_LABEL(DT_ALIAS(uart_dbg)) +#else +// cppcheck-suppress preprocessorErrorDirective +#error "No UART for ThingSet serial defined." +#endif struct device *uart_dev = device_get_binding(UART_DEVICE_NAME); diff --git a/zephyr/Kconfig b/zephyr/Kconfig index fe0935f..369325f 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -161,6 +161,14 @@ config EXT_OLED_BRIGHTNESS range 1 255 default 1 +config UEXT_SERIAL_THINGSET + depends on THINGSET_SERIAL + bool "Use UEXT serial for ThingSet interface" + default n + help + If the ThingSet interface is not attached to the serial port in the UEXT connector, the + debug serial connector is used (if existing). + endmenu # UEXT port