aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32g4/src
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/stm32g4/src
parentd881f3ad9186cf3279aa1ba27093bad94035c186 (diff)
Remove HAL initialization from #[embassy::main] macro.
Diffstat (limited to 'examples/stm32g4/src')
-rw-r--r--examples/stm32g4/src/bin/blinky.rs4
-rw-r--r--examples/stm32g4/src/bin/button_exti.rs4
-rw-r--r--examples/stm32g4/src/bin/pwm.rs4
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/stm32g4/src/bin/blinky.rs b/examples/stm32g4/src/bin/blinky.rs
index ea3c563b4..e905a311d 100644
--- a/examples/stm32g4/src/bin/blinky.rs
+++ b/examples/stm32g4/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.PA5, Level::High, Speed::Low); 16 let mut led = Output::new(p.PA5, Level::High, Speed::Low);
diff --git a/examples/stm32g4/src/bin/button_exti.rs b/examples/stm32g4/src/bin/button_exti.rs
index 60dfb362b..25d3bb9c2 100644
--- a/examples/stm32g4/src/bin/button_exti.rs
+++ b/examples/stm32g4/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::Down); 16 let button = Input::new(p.PC13, Pull::Down);
diff --git a/examples/stm32g4/src/bin/pwm.rs b/examples/stm32g4/src/bin/pwm.rs
index 7c16d0a3a..f10da3d6e 100644
--- a/examples/stm32g4/src/bin/pwm.rs
+++ b/examples/stm32g4/src/bin/pwm.rs
@@ -8,11 +8,11 @@ use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; 8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm};
9use embassy_stm32::pwm::Channel; 9use embassy_stm32::pwm::Channel;
10use embassy_stm32::time::khz; 10use embassy_stm32::time::khz;
11use embassy_stm32::Peripherals;
12use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
13 12
14#[embassy_executor::main] 13#[embassy_executor::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner) {
15 let p = embassy_stm32::init(Default::default());
16 info!("Hello World!"); 16 info!("Hello World!");
17 17
18 let ch1 = PwmPin::new_ch1(p.PA5); 18 let ch1 = PwmPin::new_ch1(p.PA5);