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

tests/periph/selftest_shield: release UART after test

Calling `uart_poweroff()` when done with the UART test allows sharing
the underlying hardware e.g. to provide other peripheral interfaces.
One example of this would be the SERCOM3 on the Adafruit Metro M4
Express that is used to provide UART on D1/D0 and SPI on D11/D12/D13.
This commit is contained in:
Marian Buschsieweke 2024-11-21 14:01:01 +01:00
parent 08c032a3f0
commit e7ea668a7f
No known key found for this signature in database
GPG Key ID: 758BD52517F79C41

View File

@ -790,6 +790,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;
} }