diff options
| author | huntc <[email protected]> | 2021-07-15 12:08:35 +1000 |
|---|---|---|
| committer | huntc <[email protected]> | 2021-07-15 12:31:53 +1000 |
| commit | 3778f55d80f70b336f6ca846f365cf619032a685 (patch) | |
| tree | c8208386107aac157217758b838da4789f85186a /examples | |
| parent | 6f78527aeb7a0bacb02ca3264edd04d37550ea02 (diff) | |
Provides a cleaner construction of the channel with the common "new" naming
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf/src/bin/mpsc.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/nrf/src/bin/mpsc.rs b/examples/nrf/src/bin/mpsc.rs index c2cb107e1..443955239 100644 --- a/examples/nrf/src/bin/mpsc.rs +++ b/examples/nrf/src/bin/mpsc.rs | |||
| @@ -37,9 +37,10 @@ async fn my_task(sender: Sender<'static, WithNoThreads, LedState, 1>) { | |||
| 37 | 37 | ||
| 38 | #[embassy::main] | 38 | #[embassy::main] |
| 39 | async fn main(spawner: Spawner, p: Peripherals) { | 39 | async fn main(spawner: Spawner, p: Peripherals) { |
| 40 | |||
| 40 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); | 41 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); |
| 41 | 42 | ||
| 42 | let channel = CHANNEL.put(Channel::with_no_threads()); | 43 | let channel = CHANNEL.put(Channel::new()); |
| 43 | let (sender, mut receiver) = mpsc::split(channel); | 44 | let (sender, mut receiver) = mpsc::split(channel); |
| 44 | 45 | ||
| 45 | spawner.spawn(my_task(sender)).unwrap(); | 46 | spawner.spawn(my_task(sender)).unwrap(); |
