aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/rng.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-01-14 22:02:00 +0100
committerDario Nieuwenhuis <[email protected]>2022-01-19 17:59:55 +0100
commit58fc64722c65bbdc209ae0fd1700f03702bbcd08 (patch)
tree77f9412b47259cd4cf4170b0a257b371398d4f2c /examples/stm32h7/src/bin/rng.rs
parent52e156b429417bde59d0ea67d11256866f1dcec9 (diff)
stm32/gpio: expose all functionality as inherent methods.
Diffstat (limited to 'examples/stm32h7/src/bin/rng.rs')
-rw-r--r--examples/stm32h7/src/bin/rng.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/stm32h7/src/bin/rng.rs b/examples/stm32h7/src/bin/rng.rs
index d64ad9bcd..8e03861d5 100644
--- a/examples/stm32h7/src/bin/rng.rs
+++ b/examples/stm32h7/src/bin/rng.rs
@@ -10,7 +10,6 @@ use embassy::traits::rng::Random;
10use embassy_stm32::gpio::{Level, Output, Speed}; 10use embassy_stm32::gpio::{Level, Output, Speed};
11use embassy_stm32::rng::Rng; 11use embassy_stm32::rng::Rng;
12use embassy_stm32::Peripherals; 12use embassy_stm32::Peripherals;
13use embedded_hal::digital::v2::OutputPin;
14use example_common::*; 13use example_common::*;
15 14
16#[embassy::main] 15#[embassy::main]
@@ -23,11 +22,11 @@ async fn main(_spawner: Spawner, p: Peripherals) {
23 22
24 loop { 23 loop {
25 info!("high {}", unwrap!(rng.next_u8(16).await)); 24 info!("high {}", unwrap!(rng.next_u8(16).await));
26 unwrap!(led.set_high()); 25 led.set_high();
27 Timer::after(Duration::from_millis(500)).await; 26 Timer::after(Duration::from_millis(500)).await;
28 27
29 info!("low {}", unwrap!(rng.next_u8(16).await)); 28 info!("low {}", unwrap!(rng.next_u8(16).await));
30 unwrap!(led.set_low()); 29 led.set_low();
31 Timer::after(Duration::from_millis(500)).await; 30 Timer::after(Duration::from_millis(500)).await;
32 } 31 }
33} 32}