1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #21042 from maribu/tests/periph/selftest_shield/fix-uart

tests/periph/selftest_shield: Fix UART test
This commit is contained in:
Marian Buschsieweke 2024-11-26 15:47:43 +00:00 committed by GitHub
commit 3b238f7db3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,10 +55,14 @@
/* In order to run the periph_uart test all of the following needs to be true: /* In order to run the periph_uart test all of the following needs to be true:
* - periph_uart needs to be used * - periph_uart needs to be used
* - an I/O mapping for the UART at D0/D1 needs to be provided * - 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)
*/ */
#if defined(ARDUINO_UART_D0D1) && defined(MODULE_PERIPH_UART) #if defined(ARDUINO_UART_D0D1) && defined(MODULE_PERIPH_UART)
# if MODULE_STDIO_UART
# define ENABLE_UART_TEST (STDIO_UART_DEV != ARDUINO_UART_D0D1) # define ENABLE_UART_TEST (STDIO_UART_DEV != ARDUINO_UART_D0D1)
# else
# define ENABLE_UART_TEST 1
# endif
# define UART_TEST_DEV ARDUINO_UART_D0D1 # define UART_TEST_DEV ARDUINO_UART_D0D1
#else #else
# define ENABLE_UART_TEST 0 # define ENABLE_UART_TEST 0
@ -790,6 +794,9 @@ static bool periph_uart_rxtx_test(uint32_t symbolrate, uint32_t timer_freq)
failed |= TEST(memcmp(testdata, serial_buf.data, sizeof(serial_buf.data)) == 0); failed |= TEST(memcmp(testdata, serial_buf.data, sizeof(serial_buf.data)) == 0);
failed |= TEST(serial_buf.pos == sizeof(testdata)); failed |= TEST(serial_buf.pos == sizeof(testdata));
/* disable UART again, in case it is a shared peripheral */
uart_poweroff(UART_TEST_DEV);
return failed; return failed;
} }