Skip to content

Commit 36557b4

Browse files
committed
Fix race condition in gpio input_puller test
The puller pin state was not updating fast enough. Insert a slight delay, so this does not happen
1 parent e42c430 commit 36557b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

testsuite/tests/gpio_input_puller.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ mod tests {
5454
state
5555
.puller
5656
.set_internal_resistor(&mut state.pupdr, Resistor::PullDown);
57+
cortex_m::asm::delay(10);
5758
assert!(unwrap!(state.puller.is_low()));
5859
assert!(unwrap!(state.observer.is_low()));
5960
}
@@ -63,6 +64,7 @@ mod tests {
6364
state
6465
.puller
6566
.set_internal_resistor(&mut state.pupdr, Resistor::PullUp);
67+
cortex_m::asm::delay(10);
6668
assert!(unwrap!(state.puller.is_high()));
6769
assert!(unwrap!(state.observer.is_high()));
6870
}

0 commit comments

Comments
 (0)