Skip to content

Commit

Permalink
tests/periph/selftest_shield: fix logic to enable UART test
Browse files Browse the repository at this point in the history
We cannot use the D0/D1 UART if it is also used for STDIO. However,
the logic did not take into account whether `stdio_uart` was used at
all. This fixes the issue.
  • Loading branch information
maribu committed Nov 26, 2024
1 parent e7ea668 commit a51d4bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/periph/selftest_shield/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@
/* In order to run the periph_uart test all of the following needs to be true:
* - periph_uart needs to be used
* - an I/O mapping for the UART at D0/D1 needs to be provided
* - this UART dev is not busy with stdio
* - this UART dev is not busy with stdio (either not using `stdio_uart` or a different UART is used for stdio)

Check warning on line 58 in tests/periph/selftest_shield/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*/
#if defined(ARDUINO_UART_D0D1) && defined(MODULE_PERIPH_UART)
# define ENABLE_UART_TEST (STDIO_UART_DEV != ARDUINO_UART_D0D1)
# if MODULE_STDIO_UART
# define ENABLE_UART_TEST (STDIO_UART_DEV != ARDUINO_UART_D0D1)
# else
# define ENABLE_UART_TEST 1
# endif
# define UART_TEST_DEV ARDUINO_UART_D0D1
#else
# define ENABLE_UART_TEST 0
Expand Down

0 comments on commit a51d4bd

Please sign in to comment.