aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-09-12 23:36:52 +0200
committerDario Nieuwenhuis <[email protected]>2021-09-13 00:08:41 +0200
commit70e5877d6823ba0894241e8bedc5cefa7e21bceb (patch)
treec8f8671800eff4f2497ea8e4c7a96ba752db4aaa /examples/nrf
parent5be5bdfd20900ee1973097cf46ec946cad547e30 (diff)
embassy/channel: switch to use MutexKind
Diffstat (limited to 'examples/nrf')
-rw-r--r--examples/nrf/src/bin/mpsc.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/nrf/src/bin/mpsc.rs b/examples/nrf/src/bin/mpsc.rs
index 79fa3dfb9..c85b7c282 100644
--- a/examples/nrf/src/bin/mpsc.rs
+++ b/examples/nrf/src/bin/mpsc.rs
@@ -6,7 +6,8 @@
6mod example_common; 6mod example_common;
7 7
8use defmt::unwrap; 8use defmt::unwrap;
9use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError, WithNoThreads}; 9use embassy::blocking_mutex::kind::Noop;
10use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError};
10use embassy::executor::Spawner; 11use embassy::executor::Spawner;
11use embassy::time::{Duration, Timer}; 12use embassy::time::{Duration, Timer};
12use embassy::util::Forever; 13use embassy::util::Forever;
@@ -19,10 +20,10 @@ enum LedState {
19 Off, 20 Off,
20} 21}
21 22
22static CHANNEL: Forever<Channel<WithNoThreads, LedState, 1>> = Forever::new(); 23static CHANNEL: Forever<Channel<Noop, LedState, 1>> = Forever::new();
23 24
24#[embassy::task(pool_size = 1)] 25#[embassy::task(pool_size = 1)]
25async fn my_task(sender: Sender<'static, WithNoThreads, LedState, 1>) { 26async fn my_task(sender: Sender<'static, Noop, LedState, 1>) {
26 loop { 27 loop {
27 let _ = sender.send(LedState::On).await; 28 let _ = sender.send(LedState::On).await;
28 Timer::after(Duration::from_secs(1)).await; 29 Timer::after(Duration::from_secs(1)).await;