aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32g0
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-08-17 18:49:55 +0200
committerDario Nieuwenhuis <[email protected]>2022-08-17 22:16:46 +0200
commitfc6e1e06b305d302d1b7ad17e8ef3a9be986c358 (patch)
tree545ad829660f6053d29a01da286d03ec3d49f5ca /examples/stm32g0
parentd881f3ad9186cf3279aa1ba27093bad94035c186 (diff)
Remove HAL initialization from #[embassy::main] macro.
Diffstat (limited to 'examples/stm32g0')
-rw-r--r--examples/stm32g0/src/bin/blinky.rs4
-rw-r--r--examples/stm32g0/src/bin/button_exti.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/stm32g0/src/bin/blinky.rs b/examples/stm32g0/src/bin/blinky.rs
index f71fe0989..249bbd88f 100644
--- a/examples/stm32g0/src/bin/blinky.rs
+++ b/examples/stm32g0/src/bin/blinky.rs
@@ -6,11 +6,11 @@ use defmt::*;
6use embassy_executor::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_executor::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
11 10
12#[embassy_executor::main] 11#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner) {
13 let p = embassy_stm32::init(Default::default());
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
16 let mut led = Output::new(p.PB7, Level::High, Speed::Low); 16 let mut led = Output::new(p.PB7, Level::High, Speed::Low);
diff --git a/examples/stm32g0/src/bin/button_exti.rs b/examples/stm32g0/src/bin/button_exti.rs
index 0832386ed..8909a1fea 100644
--- a/examples/stm32g0/src/bin/button_exti.rs
+++ b/examples/stm32g0/src/bin/button_exti.rs
@@ -6,11 +6,11 @@ use defmt::*;
6use embassy_executor::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
11 10
12#[embassy_executor::main] 11#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner) {
13 let p = embassy_stm32::init(Default::default());
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
16 let button = Input::new(p.PC13, Pull::Up); 16 let button = Input::new(p.PC13, Pull::Up);