diff options
Diffstat (limited to 'examples/nrf/src/bin')
| -rw-r--r-- | examples/nrf/src/bin/mpsc.rs | 7 |
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 @@ | |||
| 6 | mod example_common; | 6 | mod example_common; |
| 7 | 7 | ||
| 8 | use defmt::unwrap; | 8 | use defmt::unwrap; |
| 9 | use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError, WithNoThreads}; | 9 | use embassy::blocking_mutex::kind::Noop; |
| 10 | use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError}; | ||
| 10 | use embassy::executor::Spawner; | 11 | use embassy::executor::Spawner; |
| 11 | use embassy::time::{Duration, Timer}; | 12 | use embassy::time::{Duration, Timer}; |
| 12 | use embassy::util::Forever; | 13 | use embassy::util::Forever; |
| @@ -19,10 +20,10 @@ enum LedState { | |||
| 19 | Off, | 20 | Off, |
| 20 | } | 21 | } |
| 21 | 22 | ||
| 22 | static CHANNEL: Forever<Channel<WithNoThreads, LedState, 1>> = Forever::new(); | 23 | static CHANNEL: Forever<Channel<Noop, LedState, 1>> = Forever::new(); |
| 23 | 24 | ||
| 24 | #[embassy::task(pool_size = 1)] | 25 | #[embassy::task(pool_size = 1)] |
| 25 | async fn my_task(sender: Sender<'static, WithNoThreads, LedState, 1>) { | 26 | async 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; |
