diff --git a/tests/periph_uart/main.c b/tests/periph_uart/main.c index e0f9cf88f9..90afb22167 100644 --- a/tests/periph_uart/main.c +++ b/tests/periph_uart/main.c @@ -28,9 +28,12 @@ #include "msg.h" #include "ringbuffer.h" #include "periph/uart.h" -#include "stdio_uart.h" #include "xtimer.h" +#ifdef MODULE_STDIO_UART +#include "stdio_uart.h" +#endif + #ifndef SHELL_BUFSIZE #define SHELL_BUFSIZE (128U) #endif @@ -283,11 +286,15 @@ int main(void) * value given in STDIO_UART_DEV is not a numeral (depends on the CPU * implementation), so we rather break the output by printing a * non-numerical value instead of breaking the UART device descriptor */ - sleep_test(STDIO_UART_DEV, STDIO_UART_DEV); + if (STDIO_UART_DEV != UART_UNDEF) { + sleep_test(STDIO_UART_DEV, STDIO_UART_DEV); + } puts("\nUART INFO:"); printf("Available devices: %i\n", UART_NUMOF); - printf("UART used for STDIO (the shell): UART_DEV(%i)\n\n", STDIO_UART_DEV); + if (STDIO_UART_DEV != UART_UNDEF) { + printf("UART used for STDIO (the shell): UART_DEV(%i)\n\n", STDIO_UART_DEV); + } /* initialize ringbuffers */ for (unsigned i = 0; i < UART_NUMOF; i++) {