aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7
diff options
context:
space:
mode:
authorThales Fragoso <[email protected]>2021-06-25 17:32:24 -0300
committerThales Fragoso <[email protected]>2021-06-25 18:16:43 -0300
commit0eaadfc1253285c04340e32f14efa1133cb30dbe (patch)
treeb84c3ac128e1126f9b9c4a7b31f236b46ed8f172 /examples/stm32h7
parenta3f0aa02a4cf12df9ce7b7bda02a56b74bf028ab (diff)
stm32: Update gpio examples
Diffstat (limited to 'examples/stm32h7')
-rw-r--r--examples/stm32h7/src/bin/blinky.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/stm32h7/src/bin/blinky.rs b/examples/stm32h7/src/bin/blinky.rs
index c425b7f8e..d9f891e49 100644
--- a/examples/stm32h7/src/bin/blinky.rs
+++ b/examples/stm32h7/src/bin/blinky.rs
@@ -8,15 +8,15 @@
8 8
9#[path = "../example_common.rs"] 9#[path = "../example_common.rs"]
10mod example_common; 10mod example_common;
11use embassy_stm32::gpio::{Level, Output}; 11use embassy_stm32::gpio::{Level, Output, Speed};
12use embedded_hal::digital::v2::OutputPin; 12use embedded_hal::digital::v2::OutputPin;
13use example_common::*; 13use example_common::*;
14 14
15use cortex_m_rt::entry; 15use cortex_m_rt::entry;
16use stm32h7::stm32h743 as pac; 16use stm32h7::stm32h743 as pac;
17 17
18use stm32h7xx_hal as hal;
19use hal::prelude::*; 18use hal::prelude::*;
19use stm32h7xx_hal as hal;
20 20
21#[entry] 21#[entry]
22fn main() -> ! { 22fn main() -> ! {
@@ -24,8 +24,7 @@ fn main() -> ! {
24 24
25 let pp = pac::Peripherals::take().unwrap(); 25 let pp = pac::Peripherals::take().unwrap();
26 26
27 let pwrcfg = pp.PWR.constrain() 27 let pwrcfg = pp.PWR.constrain().freeze();
28 .freeze();
29 28
30 let rcc = pp.RCC.constrain(); 29 let rcc = pp.RCC.constrain();
31 30
@@ -60,7 +59,7 @@ fn main() -> ! {
60 59
61 let p = embassy_stm32::init(Default::default()); 60 let p = embassy_stm32::init(Default::default());
62 61
63 let mut led = Output::new(p.PB14, Level::High); 62 let mut led = Output::new(p.PB14, Level::High, Speed::Low);
64 63
65 loop { 64 loop {
66 info!("high"); 65 info!("high");
@@ -71,5 +70,4 @@ fn main() -> ! {
71 led.set_low().unwrap(); 70 led.set_low().unwrap();
72 cortex_m::asm::delay(10_000_000); 71 cortex_m::asm::delay(10_000_000);
73 } 72 }
74
75} 73}