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/stm32f0 | |
| parent | 34ff67cdbf25e278ff99bd4a05b6b8c6a30fa5d1 (diff) | |
executor: return error when creating the spawntoken, not when spawning.
Diffstat (limited to 'examples/stm32f0')
| -rw-r--r-- | examples/stm32f0/src/bin/button_controlled_blink.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f0/src/bin/multiprio.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/stm32f0/src/bin/button_controlled_blink.rs b/examples/stm32f0/src/bin/button_controlled_blink.rs index 744df3e3b..f232e3290 100644 --- a/examples/stm32f0/src/bin/button_controlled_blink.rs +++ b/examples/stm32f0/src/bin/button_controlled_blink.rs | |||
| @@ -46,7 +46,7 @@ async fn main(spawner: Spawner) { | |||
| 46 | BLINK_MS.store(del_var, Ordering::Relaxed); | 46 | BLINK_MS.store(del_var, Ordering::Relaxed); |
| 47 | 47 | ||
| 48 | // Spawn LED blinking task | 48 | // Spawn LED blinking task |
| 49 | spawner.spawn(led_task(p.PA5.into())).unwrap(); | 49 | spawner.spawn(led_task(p.PA5.into()).unwrap()); |
| 50 | 50 | ||
| 51 | loop { | 51 | loop { |
| 52 | // Check if button got pressed | 52 | // Check if button got pressed |
diff --git a/examples/stm32f0/src/bin/multiprio.rs b/examples/stm32f0/src/bin/multiprio.rs index 84e4077ef..b5244afc8 100644 --- a/examples/stm32f0/src/bin/multiprio.rs +++ b/examples/stm32f0/src/bin/multiprio.rs | |||
| @@ -134,16 +134,16 @@ fn main() -> ! { | |||
| 134 | // High-priority executor: USART1, priority level 6 | 134 | // High-priority executor: USART1, priority level 6 |
| 135 | interrupt::USART1.set_priority(Priority::P6); | 135 | interrupt::USART1.set_priority(Priority::P6); |
| 136 | let spawner = EXECUTOR_HIGH.start(interrupt::USART1); | 136 | let spawner = EXECUTOR_HIGH.start(interrupt::USART1); |
| 137 | unwrap!(spawner.spawn(run_high())); | 137 | spawner.spawn(unwrap!(run_high())); |
| 138 | 138 | ||
| 139 | // Medium-priority executor: USART2, priority level 7 | 139 | // Medium-priority executor: USART2, priority level 7 |
| 140 | interrupt::USART2.set_priority(Priority::P7); | 140 | interrupt::USART2.set_priority(Priority::P7); |
| 141 | let spawner = EXECUTOR_MED.start(interrupt::USART2); | 141 | let spawner = EXECUTOR_MED.start(interrupt::USART2); |
| 142 | unwrap!(spawner.spawn(run_med())); | 142 | spawner.spawn(unwrap!(run_med())); |
| 143 | 143 | ||
| 144 | // Low priority executor: runs in thread mode, using WFE/SEV | 144 | // Low priority executor: runs in thread mode, using WFE/SEV |
| 145 | let executor = EXECUTOR_LOW.init(Executor::new()); | 145 | let executor = EXECUTOR_LOW.init(Executor::new()); |
| 146 | executor.run(|spawner| { | 146 | executor.run(|spawner| { |
| 147 | unwrap!(spawner.spawn(run_low())); | 147 | spawner.spawn(unwrap!(run_low())); |
| 148 | }); | 148 | }); |
| 149 | } | 149 | } |
