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/nrf/src/bin/mpsc.rs | 6 +++--- examples/nrf/src/bin/uart_split.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'examples/nrf/src') diff --git a/examples/nrf/src/bin/mpsc.rs b/examples/nrf/src/bin/mpsc.rs index 454fb9541..d50736d82 100644 --- a/examples/nrf/src/bin/mpsc.rs +++ b/examples/nrf/src/bin/mpsc.rs @@ -6,7 +6,7 @@ mod example_common; use defmt::unwrap; -use embassy::blocking_mutex::kind::Noop; +use embassy::blocking_mutex::raw::NoopRawMutex; use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError}; use embassy::executor::Spawner; use embassy::time::{Duration, Timer}; @@ -19,10 +19,10 @@ enum LedState { Off, } -static CHANNEL: Forever> = Forever::new(); +static CHANNEL: Forever> = Forever::new(); #[embassy::task(pool_size = 1)] -async fn my_task(sender: Sender<'static, Noop, LedState, 1>) { +async fn my_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) { loop { let _ = sender.send(LedState::On).await; Timer::after(Duration::from_secs(1)).await; diff --git a/examples/nrf/src/bin/uart_split.rs b/examples/nrf/src/bin/uart_split.rs index a9c02e796..9a9bad3e9 100644 --- a/examples/nrf/src/bin/uart_split.rs +++ b/examples/nrf/src/bin/uart_split.rs @@ -6,7 +6,7 @@ mod example_common; use example_common::*; -use embassy::blocking_mutex::kind::Noop; +use embassy::blocking_mutex::raw::NoopRawMutex; use embassy::channel::mpsc::{self, Channel, Sender}; use embassy::executor::Spawner; use embassy::util::Forever; @@ -15,7 +15,7 @@ use embassy_nrf::peripherals::UARTE0; use embassy_nrf::uarte::UarteRx; use embassy_nrf::{interrupt, uarte, Peripherals}; -static CHANNEL: Forever> = Forever::new(); +static CHANNEL: Forever> = Forever::new(); #[embassy::main] async fn main(spawner: Spawner, p: Peripherals) { @@ -57,7 +57,7 @@ async fn main(spawner: Spawner, p: Peripherals) { } #[embassy::task] -async fn reader(mut rx: UarteRx<'static, UARTE0>, s: Sender<'static, Noop, [u8; 8], 1>) { +async fn reader(mut rx: UarteRx<'static, UARTE0>, s: Sender<'static, NoopRawMutex, [u8; 8], 1>) { let mut buf = [0; 8]; loop { info!("reading..."); -- cgit