diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-04-25 20:21:32 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-04-25 20:21:32 +0000 |
| commit | a39d796c3de9c96ea4df6b9da525cb0d5ef60fc0 (patch) | |
| tree | 77db234bb173a5da49e1815e82f3dd29402db79d /examples/nrf/src/bin/multiprio.rs | |
| parent | 97e24b056879547bb21158c2193f67ddb9e0a790 (diff) | |
| parent | 2b0e8a330b0f2be7a8943a9e5acadf8fc7f92275 (diff) | |
Merge #730
730: Executor and task macro fixes. r=Dirbaio a=Dirbaio
See individual commits.
bors r+
Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'examples/nrf/src/bin/multiprio.rs')
| -rw-r--r-- | examples/nrf/src/bin/multiprio.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/nrf/src/bin/multiprio.rs b/examples/nrf/src/bin/multiprio.rs index e69f87d85..54f6606a9 100644 --- a/examples/nrf/src/bin/multiprio.rs +++ b/examples/nrf/src/bin/multiprio.rs | |||
| @@ -124,17 +124,15 @@ fn main() -> ! { | |||
| 124 | let irq = interrupt::take!(SWI1_EGU1); | 124 | let irq = interrupt::take!(SWI1_EGU1); |
| 125 | irq.set_priority(interrupt::Priority::P6); | 125 | irq.set_priority(interrupt::Priority::P6); |
| 126 | let executor = EXECUTOR_HIGH.put(InterruptExecutor::new(irq)); | 126 | let executor = EXECUTOR_HIGH.put(InterruptExecutor::new(irq)); |
| 127 | executor.start(|spawner| { | 127 | let spawner = executor.start(); |
| 128 | unwrap!(spawner.spawn(run_high())); | 128 | unwrap!(spawner.spawn(run_high())); |
| 129 | }); | ||
| 130 | 129 | ||
| 131 | // Medium-priority executor: SWI0_EGU0, priority level 7 | 130 | // Medium-priority executor: SWI0_EGU0, priority level 7 |
| 132 | let irq = interrupt::take!(SWI0_EGU0); | 131 | let irq = interrupt::take!(SWI0_EGU0); |
| 133 | irq.set_priority(interrupt::Priority::P7); | 132 | irq.set_priority(interrupt::Priority::P7); |
| 134 | let executor = EXECUTOR_MED.put(InterruptExecutor::new(irq)); | 133 | let executor = EXECUTOR_MED.put(InterruptExecutor::new(irq)); |
| 135 | executor.start(|spawner| { | 134 | let spawner = executor.start(); |
| 136 | unwrap!(spawner.spawn(run_med())); | 135 | unwrap!(spawner.spawn(run_med())); |
| 137 | }); | ||
| 138 | 136 | ||
| 139 | // Low priority executor: runs in thread mode, using WFE/SEV | 137 | // Low priority executor: runs in thread mode, using WFE/SEV |
| 140 | let executor = EXECUTOR_LOW.put(Executor::new()); | 138 | let executor = EXECUTOR_LOW.put(Executor::new()); |
