diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-07-29 21:58:35 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-07-29 23:40:36 +0200 |
| commit | a0f1b0ee01d461607660d2d56b5b1bdc57e0d3fb (patch) | |
| tree | e60fc8f8db8ec07e55d655c1a830b07f4db0b7d2 /examples/nrf/src/bin/executor_fairness_test.rs | |
| parent | 8745d646f0976791b7098456aa61adb983fb1c18 (diff) | |
Split embassy crate into embassy-executor, embassy-util.
Diffstat (limited to 'examples/nrf/src/bin/executor_fairness_test.rs')
| -rw-r--r-- | examples/nrf/src/bin/executor_fairness_test.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/nrf/src/bin/executor_fairness_test.rs b/examples/nrf/src/bin/executor_fairness_test.rs index 5a4221519..b98454936 100644 --- a/examples/nrf/src/bin/executor_fairness_test.rs +++ b/examples/nrf/src/bin/executor_fairness_test.rs | |||
| @@ -5,12 +5,12 @@ | |||
| 5 | use core::task::Poll; | 5 | use core::task::Poll; |
| 6 | 6 | ||
| 7 | use defmt::{info, unwrap}; | 7 | use defmt::{info, unwrap}; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy::time::{Duration, Instant, Timer}; | 9 | use embassy_executor::time::{Duration, Instant, Timer}; |
| 10 | use embassy_nrf::Peripherals; | 10 | use embassy_nrf::Peripherals; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::task] | 13 | #[embassy_executor::task] |
| 14 | async fn run1() { | 14 | async fn run1() { |
| 15 | loop { | 15 | loop { |
| 16 | info!("DING DONG"); | 16 | info!("DING DONG"); |
| @@ -18,14 +18,14 @@ async fn run1() { | |||
| 18 | } | 18 | } |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | #[embassy::task] | 21 | #[embassy_executor::task] |
| 22 | async fn run2() { | 22 | async fn run2() { |
| 23 | loop { | 23 | loop { |
| 24 | Timer::at(Instant::from_ticks(0)).await; | 24 | Timer::at(Instant::from_ticks(0)).await; |
| 25 | } | 25 | } |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | #[embassy::task] | 28 | #[embassy_executor::task] |
| 29 | async fn run3() { | 29 | async fn run3() { |
| 30 | futures::future::poll_fn(|cx| { | 30 | futures::future::poll_fn(|cx| { |
| 31 | cx.waker().wake_by_ref(); | 31 | cx.waker().wake_by_ref(); |
| @@ -34,7 +34,7 @@ async fn run3() { | |||
| 34 | .await; | 34 | .await; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | #[embassy::main] | 37 | #[embassy_executor::main] |
| 38 | async fn main(spawner: Spawner, _p: Peripherals) { | 38 | async fn main(spawner: Spawner, _p: Peripherals) { |
| 39 | unwrap!(spawner.spawn(run1())); | 39 | unwrap!(spawner.spawn(run1())); |
| 40 | unwrap!(spawner.spawn(run2())); | 40 | unwrap!(spawner.spawn(run2())); |
