Skip to content

Commit

Permalink
tests/periph/selftest_shield: release UART after test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maribu committed Nov 26, 2024
1 parent 08c032a commit e7ea668
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/periph/selftest_shield/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(serial_buf.pos == sizeof(testdata));

/* disable UART again, in case it is a shared peripheral */
uart_poweroff(UART_TEST_DEV);

return failed;
}

Expand Down

0 comments on commit e7ea668

Please sign in to comment.