diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-07-09 01:49:31 +0200 |
|---|---|---|
| committer | diondokter <[email protected]> | 2025-08-29 13:23:21 +0200 |
| commit | 8aec341f28a00012e1771d5c35d2647e11830755 (patch) | |
| tree | 28ec3bad05e5dcb6ec949493688111839bb6865b /examples/rp235x/src | |
| parent | 34ff67cdbf25e278ff99bd4a05b6b8c6a30fa5d1 (diff) | |
executor: return error when creating the spawntoken, not when spawning.
Diffstat (limited to 'examples/rp235x/src')
| -rw-r--r-- | examples/rp235x/src/bin/assign_resources.rs | 6 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/blinky_two_channels.rs | 4 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/blinky_two_tasks.rs | 4 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/blinky_wifi.rs | 2 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/blinky_wifi_pico_plus_2.rs | 2 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/i2c_slave.rs | 4 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/interrupt.rs | 2 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/multicore.rs | 4 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/multiprio.rs | 6 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/pio_async.rs | 6 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/pio_rotary_encoder.rs | 4 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/pwm.rs | 4 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/shared_bus.rs | 8 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/sharing.rs | 6 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/uart_buffered_split.rs | 2 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/uart_unidir.rs | 2 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/zerocopy.rs | 4 |
17 files changed, 34 insertions, 36 deletions
diff --git a/examples/rp235x/src/bin/assign_resources.rs b/examples/rp235x/src/bin/assign_resources.rs index 341f54d22..4ee4278b5 100644 --- a/examples/rp235x/src/bin/assign_resources.rs +++ b/examples/rp235x/src/bin/assign_resources.rs | |||
| @@ -26,15 +26,13 @@ async fn main(spawner: Spawner) { | |||
| 26 | let p = embassy_rp::init(Default::default()); | 26 | let p = embassy_rp::init(Default::default()); |
| 27 | 27 | ||
| 28 | // 1) Assigning a resource to a task by passing parts of the peripherals. | 28 | // 1) Assigning a resource to a task by passing parts of the peripherals. |
| 29 | spawner | 29 | spawner.spawn(double_blinky_manually_assigned(spawner, p.PIN_20, p.PIN_21).unwrap()); |
| 30 | .spawn(double_blinky_manually_assigned(spawner, p.PIN_20, p.PIN_21)) | ||
| 31 | .unwrap(); | ||
| 32 | 30 | ||
| 33 | // 2) Using the assign-resources macro to assign resources to a task. | 31 | // 2) Using the assign-resources macro to assign resources to a task. |
| 34 | // we perform the split, see further below for the definition of the resources struct | 32 | // we perform the split, see further below for the definition of the resources struct |
| 35 | let r = split_resources!(p); | 33 | let r = split_resources!(p); |
| 36 | // and then we can use them | 34 | // and then we can use them |
| 37 | spawner.spawn(double_blinky_macro_assigned(spawner, r.leds)).unwrap(); | 35 | spawner.spawn(double_blinky_macro_assigned(spawner, r.leds).unwrap()); |
| 38 | } | 36 | } |
| 39 | 37 | ||
| 40 | // 1) Assigning a resource to a task by passing parts of the peripherals. | 38 | // 1) Assigning a resource to a task by passing parts of the peripherals. |
diff --git a/examples/rp235x/src/bin/blinky_two_channels.rs b/examples/rp235x/src/bin/blinky_two_channels.rs index 51e139e94..87f3a3545 100644 --- a/examples/rp235x/src/bin/blinky_two_channels.rs +++ b/examples/rp235x/src/bin/blinky_two_channels.rs | |||
| @@ -27,8 +27,8 @@ async fn main(spawner: Spawner) { | |||
| 27 | let dt = 100 * 1_000_000; | 27 | let dt = 100 * 1_000_000; |
| 28 | let k = 1.003; | 28 | let k = 1.003; |
| 29 | 29 | ||
| 30 | unwrap!(spawner.spawn(toggle_led(CHANNEL.sender(), Duration::from_nanos(dt)))); | 30 | spawner.spawn(unwrap!(toggle_led(CHANNEL.sender(), Duration::from_nanos(dt)))); |
| 31 | unwrap!(spawner.spawn(toggle_led( | 31 | spawner.spawn(unwrap!(toggle_led( |
| 32 | CHANNEL.sender(), | 32 | CHANNEL.sender(), |
| 33 | Duration::from_nanos((dt as f64 * k) as u64) | 33 | Duration::from_nanos((dt as f64 * k) as u64) |
| 34 | ))); | 34 | ))); |
diff --git a/examples/rp235x/src/bin/blinky_two_tasks.rs b/examples/rp235x/src/bin/blinky_two_tasks.rs index 67a9108c0..aac7d928b 100644 --- a/examples/rp235x/src/bin/blinky_two_tasks.rs +++ b/examples/rp235x/src/bin/blinky_two_tasks.rs | |||
| @@ -30,8 +30,8 @@ async fn main(spawner: Spawner) { | |||
| 30 | let dt = 100 * 1_000_000; | 30 | let dt = 100 * 1_000_000; |
| 31 | let k = 1.003; | 31 | let k = 1.003; |
| 32 | 32 | ||
| 33 | unwrap!(spawner.spawn(toggle_led(&LED, Duration::from_nanos(dt)))); | 33 | spawner.spawn(unwrap!(toggle_led(&LED, Duration::from_nanos(dt)))); |
| 34 | unwrap!(spawner.spawn(toggle_led(&LED, Duration::from_nanos((dt as f64 * k) as u64)))); | 34 | spawner.spawn(unwrap!(toggle_led(&LED, Duration::from_nanos((dt as f64 * k) as u64)))); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | #[embassy_executor::task(pool_size = 2)] | 37 | #[embassy_executor::task(pool_size = 2)] |
diff --git a/examples/rp235x/src/bin/blinky_wifi.rs b/examples/rp235x/src/bin/blinky_wifi.rs index ef6057a1c..b2201f0ae 100644 --- a/examples/rp235x/src/bin/blinky_wifi.rs +++ b/examples/rp235x/src/bin/blinky_wifi.rs | |||
| @@ -71,7 +71,7 @@ async fn main(spawner: Spawner) { | |||
| 71 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); | 71 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 72 | let state = STATE.init(cyw43::State::new()); | 72 | let state = STATE.init(cyw43::State::new()); |
| 73 | let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; | 73 | let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; |
| 74 | unwrap!(spawner.spawn(cyw43_task(runner))); | 74 | spawner.spawn(unwrap!(cyw43_task(runner))); |
| 75 | 75 | ||
| 76 | control.init(clm).await; | 76 | control.init(clm).await; |
| 77 | control | 77 | control |
diff --git a/examples/rp235x/src/bin/blinky_wifi_pico_plus_2.rs b/examples/rp235x/src/bin/blinky_wifi_pico_plus_2.rs index 0a5bccfb3..e6d6f687b 100644 --- a/examples/rp235x/src/bin/blinky_wifi_pico_plus_2.rs +++ b/examples/rp235x/src/bin/blinky_wifi_pico_plus_2.rs | |||
| @@ -68,7 +68,7 @@ async fn main(spawner: Spawner) { | |||
| 68 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); | 68 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 69 | let state = STATE.init(cyw43::State::new()); | 69 | let state = STATE.init(cyw43::State::new()); |
| 70 | let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; | 70 | let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; |
| 71 | unwrap!(spawner.spawn(cyw43_task(runner))); | 71 | spawner.spawn(unwrap!(cyw43_task(runner))); |
| 72 | 72 | ||
| 73 | control.init(clm).await; | 73 | control.init(clm).await; |
| 74 | control | 74 | control |
diff --git a/examples/rp235x/src/bin/i2c_slave.rs b/examples/rp235x/src/bin/i2c_slave.rs index 9fffb4646..02ad9a003 100644 --- a/examples/rp235x/src/bin/i2c_slave.rs +++ b/examples/rp235x/src/bin/i2c_slave.rs | |||
| @@ -105,7 +105,7 @@ async fn main(spawner: Spawner) { | |||
| 105 | config.addr = DEV_ADDR as u16; | 105 | config.addr = DEV_ADDR as u16; |
| 106 | let device = i2c_slave::I2cSlave::new(p.I2C1, d_sda, d_scl, Irqs, config); | 106 | let device = i2c_slave::I2cSlave::new(p.I2C1, d_sda, d_scl, Irqs, config); |
| 107 | 107 | ||
| 108 | unwrap!(spawner.spawn(device_task(device))); | 108 | spawner.spawn(unwrap!(device_task(device))); |
| 109 | 109 | ||
| 110 | let c_sda = p.PIN_1; | 110 | let c_sda = p.PIN_1; |
| 111 | let c_scl = p.PIN_0; | 111 | let c_scl = p.PIN_0; |
| @@ -113,5 +113,5 @@ async fn main(spawner: Spawner) { | |||
| 113 | config.frequency = 1_000_000; | 113 | config.frequency = 1_000_000; |
| 114 | let controller = i2c::I2c::new_async(p.I2C0, c_sda, c_scl, Irqs, config); | 114 | let controller = i2c::I2c::new_async(p.I2C0, c_sda, c_scl, Irqs, config); |
| 115 | 115 | ||
| 116 | unwrap!(spawner.spawn(controller_task(controller))); | 116 | spawner.spawn(unwrap!(controller_task(controller))); |
| 117 | } | 117 | } |
diff --git a/examples/rp235x/src/bin/interrupt.rs b/examples/rp235x/src/bin/interrupt.rs index e9ac76486..88513180c 100644 --- a/examples/rp235x/src/bin/interrupt.rs +++ b/examples/rp235x/src/bin/interrupt.rs | |||
| @@ -51,7 +51,7 @@ async fn main(spawner: Spawner) { | |||
| 51 | // No Mutex needed when sharing within the same executor/prio level | 51 | // No Mutex needed when sharing within the same executor/prio level |
| 52 | static AVG: StaticCell<Cell<u32>> = StaticCell::new(); | 52 | static AVG: StaticCell<Cell<u32>> = StaticCell::new(); |
| 53 | let avg = AVG.init(Default::default()); | 53 | let avg = AVG.init(Default::default()); |
| 54 | spawner.must_spawn(processing(avg)); | 54 | spawner.spawn(processing(avg).unwrap()); |
| 55 | 55 | ||
| 56 | let mut ticker = Ticker::every(Duration::from_secs(1)); | 56 | let mut ticker = Ticker::every(Duration::from_secs(1)); |
| 57 | loop { | 57 | loop { |
diff --git a/examples/rp235x/src/bin/multicore.rs b/examples/rp235x/src/bin/multicore.rs index f02dc3876..4f82801d6 100644 --- a/examples/rp235x/src/bin/multicore.rs +++ b/examples/rp235x/src/bin/multicore.rs | |||
| @@ -35,12 +35,12 @@ fn main() -> ! { | |||
| 35 | unsafe { &mut *core::ptr::addr_of_mut!(CORE1_STACK) }, | 35 | unsafe { &mut *core::ptr::addr_of_mut!(CORE1_STACK) }, |
| 36 | move || { | 36 | move || { |
| 37 | let executor1 = EXECUTOR1.init(Executor::new()); | 37 | let executor1 = EXECUTOR1.init(Executor::new()); |
| 38 | executor1.run(|spawner| unwrap!(spawner.spawn(core1_task(led)))); | 38 | executor1.run(|spawner| spawner.spawn(unwrap!(core1_task(led)))); |
| 39 | }, | 39 | }, |
| 40 | ); | 40 | ); |
| 41 | 41 | ||
| 42 | let executor0 = EXECUTOR0.init(Executor::new()); | 42 | let executor0 = EXECUTOR0.init(Executor::new()); |
| 43 | executor0.run(|spawner| unwrap!(spawner.spawn(core0_task()))); | 43 | executor0.run(|spawner| spawner.spawn(unwrap!(core0_task()))); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | #[embassy_executor::task] | 46 | #[embassy_executor::task] |
diff --git a/examples/rp235x/src/bin/multiprio.rs b/examples/rp235x/src/bin/multiprio.rs index 2b397f97d..96cdf8fb1 100644 --- a/examples/rp235x/src/bin/multiprio.rs +++ b/examples/rp235x/src/bin/multiprio.rs | |||
| @@ -130,16 +130,16 @@ fn main() -> ! { | |||
| 130 | // High-priority executor: SWI_IRQ_1, priority level 2 | 130 | // High-priority executor: SWI_IRQ_1, priority level 2 |
| 131 | interrupt::SWI_IRQ_1.set_priority(Priority::P2); | 131 | interrupt::SWI_IRQ_1.set_priority(Priority::P2); |
| 132 | let spawner = EXECUTOR_HIGH.start(interrupt::SWI_IRQ_1); | 132 | let spawner = EXECUTOR_HIGH.start(interrupt::SWI_IRQ_1); |
| 133 | unwrap!(spawner.spawn(run_high())); | 133 | spawner.spawn(unwrap!(run_high())); |
| 134 | 134 | ||
| 135 | // Medium-priority executor: SWI_IRQ_0, priority level 3 | 135 | // Medium-priority executor: SWI_IRQ_0, priority level 3 |
| 136 | interrupt::SWI_IRQ_0.set_priority(Priority::P3); | 136 | interrupt::SWI_IRQ_0.set_priority(Priority::P3); |
| 137 | let spawner = EXECUTOR_MED.start(interrupt::SWI_IRQ_0); | 137 | let spawner = EXECUTOR_MED.start(interrupt::SWI_IRQ_0); |
| 138 | unwrap!(spawner.spawn(run_med())); | 138 | spawner.spawn(unwrap!(run_med())); |
| 139 | 139 | ||
| 140 | // Low priority executor: runs in thread mode, using WFE/SEV | 140 | // Low priority executor: runs in thread mode, using WFE/SEV |
| 141 | let executor = EXECUTOR_LOW.init(Executor::new()); | 141 | let executor = EXECUTOR_LOW.init(Executor::new()); |
| 142 | executor.run(|spawner| { | 142 | executor.run(|spawner| { |
| 143 | unwrap!(spawner.spawn(run_low())); | 143 | spawner.spawn(unwrap!(run_low())); |
| 144 | }); | 144 | }); |
| 145 | } | 145 | } |
diff --git a/examples/rp235x/src/bin/pio_async.rs b/examples/rp235x/src/bin/pio_async.rs index a519b8a50..d76930f5c 100644 --- a/examples/rp235x/src/bin/pio_async.rs +++ b/examples/rp235x/src/bin/pio_async.rs | |||
| @@ -125,7 +125,7 @@ async fn main(spawner: Spawner) { | |||
| 125 | setup_pio_task_sm0(&mut common, &mut sm0, p.PIN_0); | 125 | setup_pio_task_sm0(&mut common, &mut sm0, p.PIN_0); |
| 126 | setup_pio_task_sm1(&mut common, &mut sm1); | 126 | setup_pio_task_sm1(&mut common, &mut sm1); |
| 127 | setup_pio_task_sm2(&mut common, &mut sm2); | 127 | setup_pio_task_sm2(&mut common, &mut sm2); |
| 128 | spawner.spawn(pio_task_sm0(sm0)).unwrap(); | 128 | spawner.spawn(pio_task_sm0(sm0).unwrap()); |
| 129 | spawner.spawn(pio_task_sm1(sm1)).unwrap(); | 129 | spawner.spawn(pio_task_sm1(sm1).unwrap()); |
| 130 | spawner.spawn(pio_task_sm2(irq3, sm2)).unwrap(); | 130 | spawner.spawn(pio_task_sm2(irq3, sm2).unwrap()); |
| 131 | } | 131 | } |
diff --git a/examples/rp235x/src/bin/pio_rotary_encoder.rs b/examples/rp235x/src/bin/pio_rotary_encoder.rs index e820d316d..610d1a40b 100644 --- a/examples/rp235x/src/bin/pio_rotary_encoder.rs +++ b/examples/rp235x/src/bin/pio_rotary_encoder.rs | |||
| @@ -50,6 +50,6 @@ async fn main(spawner: Spawner) { | |||
| 50 | let encoder0 = PioEncoder::new(&mut common, sm0, p.PIN_4, p.PIN_5, &prg); | 50 | let encoder0 = PioEncoder::new(&mut common, sm0, p.PIN_4, p.PIN_5, &prg); |
| 51 | let encoder1 = PioEncoder::new(&mut common, sm1, p.PIN_6, p.PIN_7, &prg); | 51 | let encoder1 = PioEncoder::new(&mut common, sm1, p.PIN_6, p.PIN_7, &prg); |
| 52 | 52 | ||
| 53 | spawner.must_spawn(encoder_0(encoder0)); | 53 | spawner.spawn(encoder_0(encoder0).unwrap()); |
| 54 | spawner.must_spawn(encoder_1(encoder1)); | 54 | spawner.spawn(encoder_1(encoder1).unwrap()); |
| 55 | } | 55 | } |
diff --git a/examples/rp235x/src/bin/pwm.rs b/examples/rp235x/src/bin/pwm.rs index da1acc18a..289480c85 100644 --- a/examples/rp235x/src/bin/pwm.rs +++ b/examples/rp235x/src/bin/pwm.rs | |||
| @@ -18,8 +18,8 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 18 | #[embassy_executor::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(spawner: Spawner) { | 19 | async fn main(spawner: Spawner) { |
| 20 | let p = embassy_rp::init(Default::default()); | 20 | let p = embassy_rp::init(Default::default()); |
| 21 | spawner.spawn(pwm_set_config(p.PWM_SLICE4, p.PIN_25)).unwrap(); | 21 | spawner.spawn(pwm_set_config(p.PWM_SLICE4, p.PIN_25).unwrap()); |
| 22 | spawner.spawn(pwm_set_dutycycle(p.PWM_SLICE2, p.PIN_4)).unwrap(); | 22 | spawner.spawn(pwm_set_dutycycle(p.PWM_SLICE2, p.PIN_4).unwrap()); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | /// Demonstrate PWM by modifying & applying the config | 25 | /// Demonstrate PWM by modifying & applying the config |
diff --git a/examples/rp235x/src/bin/shared_bus.rs b/examples/rp235x/src/bin/shared_bus.rs index 9267dfccb..db7566b1a 100644 --- a/examples/rp235x/src/bin/shared_bus.rs +++ b/examples/rp235x/src/bin/shared_bus.rs | |||
| @@ -35,8 +35,8 @@ async fn main(spawner: Spawner) { | |||
| 35 | static I2C_BUS: StaticCell<I2c1Bus> = StaticCell::new(); | 35 | static I2C_BUS: StaticCell<I2c1Bus> = StaticCell::new(); |
| 36 | let i2c_bus = I2C_BUS.init(Mutex::new(i2c)); | 36 | let i2c_bus = I2C_BUS.init(Mutex::new(i2c)); |
| 37 | 37 | ||
| 38 | spawner.must_spawn(i2c_task_a(i2c_bus)); | 38 | spawner.spawn(i2c_task_a(i2c_bus).unwrap()); |
| 39 | spawner.must_spawn(i2c_task_b(i2c_bus)); | 39 | spawner.spawn(i2c_task_b(i2c_bus).unwrap()); |
| 40 | 40 | ||
| 41 | // Shared SPI bus | 41 | // Shared SPI bus |
| 42 | let spi_cfg = spi::Config::default(); | 42 | let spi_cfg = spi::Config::default(); |
| @@ -48,8 +48,8 @@ async fn main(spawner: Spawner) { | |||
| 48 | let cs_a = Output::new(p.PIN_0, Level::High); | 48 | let cs_a = Output::new(p.PIN_0, Level::High); |
| 49 | let cs_b = Output::new(p.PIN_1, Level::High); | 49 | let cs_b = Output::new(p.PIN_1, Level::High); |
| 50 | 50 | ||
| 51 | spawner.must_spawn(spi_task_a(spi_bus, cs_a)); | 51 | spawner.spawn(spi_task_a(spi_bus, cs_a).unwrap()); |
| 52 | spawner.must_spawn(spi_task_b(spi_bus, cs_b)); | 52 | spawner.spawn(spi_task_b(spi_bus, cs_b).unwrap()); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | #[embassy_executor::task] | 55 | #[embassy_executor::task] |
diff --git a/examples/rp235x/src/bin/sharing.rs b/examples/rp235x/src/bin/sharing.rs index 856be6ace..d4c89946b 100644 --- a/examples/rp235x/src/bin/sharing.rs +++ b/examples/rp235x/src/bin/sharing.rs | |||
| @@ -68,7 +68,7 @@ fn main() -> ! { | |||
| 68 | // High-priority executor: runs in interrupt mode | 68 | // High-priority executor: runs in interrupt mode |
| 69 | interrupt::SWI_IRQ_0.set_priority(Priority::P3); | 69 | interrupt::SWI_IRQ_0.set_priority(Priority::P3); |
| 70 | let spawner = EXECUTOR_HI.start(interrupt::SWI_IRQ_0); | 70 | let spawner = EXECUTOR_HI.start(interrupt::SWI_IRQ_0); |
| 71 | spawner.must_spawn(task_a(uart)); | 71 | spawner.spawn(task_a(uart).unwrap()); |
| 72 | 72 | ||
| 73 | // Low priority executor: runs in thread mode | 73 | // Low priority executor: runs in thread mode |
| 74 | let executor = EXECUTOR_LOW.init(Executor::new()); | 74 | let executor = EXECUTOR_LOW.init(Executor::new()); |
| @@ -83,8 +83,8 @@ fn main() -> ! { | |||
| 83 | static REF_CELL: ConstStaticCell<RefCell<MyType>> = ConstStaticCell::new(RefCell::new(MyType { inner: 0 })); | 83 | static REF_CELL: ConstStaticCell<RefCell<MyType>> = ConstStaticCell::new(RefCell::new(MyType { inner: 0 })); |
| 84 | let ref_cell = REF_CELL.take(); | 84 | let ref_cell = REF_CELL.take(); |
| 85 | 85 | ||
| 86 | spawner.must_spawn(task_b(uart, cell, ref_cell)); | 86 | spawner.spawn(task_b(uart, cell, ref_cell).unwrap()); |
| 87 | spawner.must_spawn(task_c(cell, ref_cell)); | 87 | spawner.spawn(task_c(cell, ref_cell).unwrap()); |
| 88 | }); | 88 | }); |
| 89 | } | 89 | } |
| 90 | 90 | ||
diff --git a/examples/rp235x/src/bin/uart_buffered_split.rs b/examples/rp235x/src/bin/uart_buffered_split.rs index 7cad09f9b..061be873d 100644 --- a/examples/rp235x/src/bin/uart_buffered_split.rs +++ b/examples/rp235x/src/bin/uart_buffered_split.rs | |||
| @@ -33,7 +33,7 @@ async fn main(spawner: Spawner) { | |||
| 33 | let uart = BufferedUart::new(uart, tx_pin, rx_pin, Irqs, tx_buf, rx_buf, Config::default()); | 33 | let uart = BufferedUart::new(uart, tx_pin, rx_pin, Irqs, tx_buf, rx_buf, Config::default()); |
| 34 | let (mut tx, rx) = uart.split(); | 34 | let (mut tx, rx) = uart.split(); |
| 35 | 35 | ||
| 36 | unwrap!(spawner.spawn(reader(rx))); | 36 | spawner.spawn(unwrap!(reader(rx))); |
| 37 | 37 | ||
| 38 | info!("Writing..."); | 38 | info!("Writing..."); |
| 39 | loop { | 39 | loop { |
diff --git a/examples/rp235x/src/bin/uart_unidir.rs b/examples/rp235x/src/bin/uart_unidir.rs index 45c9c8407..0c80d24c9 100644 --- a/examples/rp235x/src/bin/uart_unidir.rs +++ b/examples/rp235x/src/bin/uart_unidir.rs | |||
| @@ -27,7 +27,7 @@ async fn main(spawner: Spawner) { | |||
| 27 | let mut uart_tx = UartTx::new(p.UART0, p.PIN_0, p.DMA_CH0, Config::default()); | 27 | let mut uart_tx = UartTx::new(p.UART0, p.PIN_0, p.DMA_CH0, Config::default()); |
| 28 | let uart_rx = UartRx::new(p.UART1, p.PIN_5, Irqs, p.DMA_CH1, Config::default()); | 28 | let uart_rx = UartRx::new(p.UART1, p.PIN_5, Irqs, p.DMA_CH1, Config::default()); |
| 29 | 29 | ||
| 30 | unwrap!(spawner.spawn(reader(uart_rx))); | 30 | spawner.spawn(unwrap!(reader(uart_rx))); |
| 31 | 31 | ||
| 32 | info!("Writing..."); | 32 | info!("Writing..."); |
| 33 | loop { | 33 | loop { |
diff --git a/examples/rp235x/src/bin/zerocopy.rs b/examples/rp235x/src/bin/zerocopy.rs index 086c86cac..62ba4cfb8 100644 --- a/examples/rp235x/src/bin/zerocopy.rs +++ b/examples/rp235x/src/bin/zerocopy.rs | |||
| @@ -52,8 +52,8 @@ async fn main(spawner: Spawner) { | |||
| 52 | let channel = CHANNEL.init(Channel::new(buf)); | 52 | let channel = CHANNEL.init(Channel::new(buf)); |
| 53 | let (sender, receiver) = channel.split(); | 53 | let (sender, receiver) = channel.split(); |
| 54 | 54 | ||
| 55 | spawner.must_spawn(consumer(receiver)); | 55 | spawner.spawn(consumer(receiver).unwrap()); |
| 56 | spawner.must_spawn(producer(sender, adc_parts)); | 56 | spawner.spawn(producer(sender, adc_parts).unwrap()); |
| 57 | 57 | ||
| 58 | let mut ticker = Ticker::every(Duration::from_secs(1)); | 58 | let mut ticker = Ticker::every(Duration::from_secs(1)); |
| 59 | loop { | 59 | loop { |
