From 6c925b2342708266f24d58020e89786811531d47 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 11 Feb 2022 23:25:30 +0100 Subject: blocking_mutex: refactor to work on stable. No GATs, and can be constructed in const. --- examples/stm32f3/src/bin/button_events.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'examples/stm32f3/src/bin') diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs index 720ed9d1..1218edd2 100644 --- a/examples/stm32f3/src/bin/button_events.rs +++ b/examples/stm32f3/src/bin/button_events.rs @@ -12,7 +12,7 @@ #[path = "../example_common.rs"] mod example_common; -use embassy::blocking_mutex::kind::Noop; +use embassy::blocking_mutex::raw::NoopRawMutex; use embassy::channel::mpsc::{self, Channel, Receiver, Sender}; use embassy::executor::Spawner; use embassy::time::{with_timeout, Duration, Timer}; @@ -77,7 +77,7 @@ enum ButtonEvent { Hold, } -static BUTTON_EVENTS_QUEUE: Forever> = Forever::new(); +static BUTTON_EVENTS_QUEUE: Forever> = Forever::new(); #[embassy::main] async fn main(spawner: Spawner, p: Peripherals) { @@ -103,7 +103,10 @@ async fn main(spawner: Spawner, p: Peripherals) { } #[embassy::task] -async fn led_blinker(mut leds: Leds<'static>, queue: Receiver<'static, Noop, ButtonEvent, 4>) { +async fn led_blinker( + mut leds: Leds<'static>, + queue: Receiver<'static, NoopRawMutex, ButtonEvent, 4>, +) { loop { leds.blink().await; match queue.try_recv() { @@ -121,7 +124,7 @@ async fn led_blinker(mut leds: Leds<'static>, queue: Receiver<'static, Noop, But #[embassy::task] async fn button_waiter( mut button: ExtiInput<'static, PA0>, - queue: Sender<'static, Noop, ButtonEvent, 4>, + queue: Sender<'static, NoopRawMutex, ButtonEvent, 4>, ) { const DOUBLE_CLICK_DELAY: u64 = 250; const HOLD_DELAY: u64 = 1000; -- cgit v1.2.3