aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32g0/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32g0/src')
-rw-r--r--examples/stm32g0/src/bin/blinky.rs5
-rw-r--r--examples/stm32g0/src/bin/button.rs3
2 files changed, 3 insertions, 5 deletions
diff --git a/examples/stm32g0/src/bin/blinky.rs b/examples/stm32g0/src/bin/blinky.rs
index c4857195f..00d67dac0 100644
--- a/examples/stm32g0/src/bin/blinky.rs
+++ b/examples/stm32g0/src/bin/blinky.rs
@@ -8,7 +8,6 @@ use embassy::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed}; 9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use embedded_hal::digital::v2::OutputPin;
12use example_common::*; 11use example_common::*;
13 12
14#[embassy::main] 13#[embassy::main]
@@ -19,11 +18,11 @@ async fn main(_spawner: Spawner, p: Peripherals) {
19 18
20 loop { 19 loop {
21 info!("high"); 20 info!("high");
22 unwrap!(led.set_high()); 21 led.set_high();
23 Timer::after(Duration::from_millis(300)).await; 22 Timer::after(Duration::from_millis(300)).await;
24 23
25 info!("low"); 24 info!("low");
26 unwrap!(led.set_low()); 25 led.set_low();
27 Timer::after(Duration::from_millis(300)).await; 26 Timer::after(Duration::from_millis(300)).await;
28 } 27 }
29} 28}
diff --git a/examples/stm32g0/src/bin/button.rs b/examples/stm32g0/src/bin/button.rs
index 4ca2a43b2..e901c5750 100644
--- a/examples/stm32g0/src/bin/button.rs
+++ b/examples/stm32g0/src/bin/button.rs
@@ -6,7 +6,6 @@
6mod example_common; 6mod example_common;
7use cortex_m_rt::entry; 7use cortex_m_rt::entry;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embedded_hal::digital::v2::InputPin;
10use example_common::*; 9use example_common::*;
11 10
12#[entry] 11#[entry]
@@ -18,7 +17,7 @@ fn main() -> ! {
18 let button = Input::new(p.PC13, Pull::Up); 17 let button = Input::new(p.PC13, Pull::Up);
19 18
20 loop { 19 loop {
21 if unwrap!(button.is_high()) { 20 if button.is_high() {
22 info!("high"); 21 info!("high");
23 } else { 22 } else {
24 info!("low"); 23 info!("low");