mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 22:13:52 +01:00
tests/periph/gpio_ll: add delays to test_switch_dir()
In all other tests we added a delay after writing to the output buffer of GPIO A before expected the input buffer of GPIO B (connected to A) to reflect the change, but not in test_switch_dir(). This adds the delay here as well to make the test more robust in regard to GPIO peripherals that react not as fast as the CPU can query them.
This commit is contained in:
parent
a6b459eff3
commit
af61cf40e3
@ -933,8 +933,10 @@ static void test_switch_dir(void)
|
||||
expect(test_passed);
|
||||
|
||||
gpio_ll_clear(port_out, mask_out);
|
||||
ztimer_sleep(ZTIMER_USEC, US_PER_MS);
|
||||
test_passed = (0 == (gpio_ll_read(port_in) & mask_in));
|
||||
gpio_ll_set(port_out, mask_out);
|
||||
ztimer_sleep(ZTIMER_USEC, US_PER_MS);
|
||||
test_passed = test_passed && (gpio_ll_read(port_in) & mask_in);
|
||||
printf_optional("Pin behaves as output after switched to output mode: %s\n",
|
||||
noyes[test_passed]);
|
||||
@ -965,8 +967,10 @@ static void test_switch_dir(void)
|
||||
expect(0 == gpio_ll_init(port_in, PIN_IN_0, gpio_ll_out));
|
||||
|
||||
gpio_ll_clear(port_in, mask_in);
|
||||
ztimer_sleep(ZTIMER_USEC, US_PER_MS);
|
||||
test_passed = (0 == (gpio_ll_read(port_out) & mask_out));
|
||||
gpio_ll_set(port_in, mask_in);
|
||||
ztimer_sleep(ZTIMER_USEC, US_PER_MS);
|
||||
test_passed = test_passed && (gpio_ll_read(port_out) & mask_out);
|
||||
printf_optional("Pin behaves as input after switched back to input mode: %s\n",
|
||||
noyes[test_passed]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user