summaryrefslogtreecommitdiff
path: root/examples/stm32f3/src/bin/button_events.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2022-08-17 18:49:55 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2022-08-17 22:16:46 +0200
commitfc6e1e06b305d302d1b7ad17e8ef3a9be986c358 (patch)
tree545ad829660f6053d29a01da286d03ec3d49f5ca /examples/stm32f3/src/bin/button_events.rs
parentd881f3ad9186cf3279aa1ba27093bad94035c186 (diff)
downloadembassy-fc6e1e06b305d302d1b7ad17e8ef3a9be986c358.zip
Remove HAL initialization from #[embassy::main] macro.
Diffstat (limited to 'examples/stm32f3/src/bin/button_events.rs')
-rw-r--r--examples/stm32f3/src/bin/button_events.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs
index ef511031..404946f2 100644
--- a/examples/stm32f3/src/bin/button_events.rs
+++ b/examples/stm32f3/src/bin/button_events.rs
@@ -16,7 +16,6 @@ use embassy_executor::time::{with_timeout, Duration, Timer};
use embassy_stm32::exti::ExtiInput;
use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed};
use embassy_stm32::peripherals::PA0;
-use embassy_stm32::Peripherals;
use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
use embassy_util::channel::mpmc::Channel;
use {defmt_rtt as _, panic_probe as _};
@@ -100,7 +99,8 @@ enum ButtonEvent {
static CHANNEL: Channel<ThreadModeRawMutex, ButtonEvent, 4> = Channel::new();
#[embassy_executor::main]
-async fn main(spawner: Spawner, p: Peripherals) {
+async fn main(spawner: Spawner) {
+ let p = embassy_stm32::init(Default::default());
let button = Input::new(p.PA0, Pull::Down);
let button = ExtiInput::new(button, p.EXTI0);
info!("Press the USER button...");