diff options
author | amugniere@gmail.com <antoine.mugnier@depixus.com> | 2022-07-08 22:24:29 +0200 |
---|---|---|
committer | amugniere@gmail.com <antoine.mugnier@depixus.com> | 2022-07-08 22:24:29 +0200 |
commit | abba86d1bac38ab0e776fe376c78017299c8f699 (patch) | |
tree | c45b8a950e4a4d8de6f7177ecf8b1bb04a59df82 /tests | |
parent | dda528808a87af23feafb709dbcd665da91d5547 (diff) | |
download | embassy-abba86d1bac38ab0e776fe376c78017299c8f699.zip |
Have added doc + minor correction
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stm32/src/bin/gpio.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs index 2cdf52c0..952d4cd6 100644 --- a/tests/stm32/src/bin/gpio.rs +++ b/tests/stm32/src/bin/gpio.rs @@ -104,20 +104,24 @@ async fn main(_spawner: Spawner, p: Peripherals) { // FLEX // Test initial output { - let mut b = Flex::new(&mut b); + //Flex pin configured as input + let mut b = Flex::new(&mut b); b.set_as_input(Pull::None); { - let mut a = Flex::new(&mut a); - a.set_low(); + //Flex pin configured as output + let mut a = Flex::new(&mut a); //Flex pin configured as output + a.set_low(); // Pin state must be set before configuring the pin, thus we avoid unknown state a.set_as_output(Speed::Low); delay(); assert!(b.is_low()); } { - let mut a = Flex::new(&mut a); - a.set_as_output(Speed::Low); + //Flex pin configured as output + let mut a = Flex::new(&mut a); a.set_high(); + a.set_as_output(Speed::Low); + delay(); assert!(b.is_high()); } @@ -125,12 +129,13 @@ async fn main(_spawner: Spawner, p: Peripherals) { // Test input no pull { - let mut b = Flex::new(&mut b); + let mut b = Flex::new(&mut b); b.set_as_input(Pull::None); // no pull, the status is undefined let mut a = Flex::new(&mut a); a.set_low(); - a.set_as_output(Speed::Low); + a.set_as_output(Speed::Low); + delay(); assert!(b.is_low()); a.set_high(); |