aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf/src/bin/executor_fairness_test.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-07-29 21:58:35 +0200
committerDario Nieuwenhuis <[email protected]>2022-07-29 23:40:36 +0200
commita0f1b0ee01d461607660d2d56b5b1bdc57e0d3fb (patch)
treee60fc8f8db8ec07e55d655c1a830b07f4db0b7d2 /examples/nrf/src/bin/executor_fairness_test.rs
parent8745d646f0976791b7098456aa61adb983fb1c18 (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.rs12
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 @@
5use core::task::Poll; 5use core::task::Poll;
6 6
7use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy::time::{Duration, Instant, Timer}; 9use embassy_executor::time::{Duration, Instant, Timer};
10use embassy_nrf::Peripherals; 10use embassy_nrf::Peripherals;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::task] 13#[embassy_executor::task]
14async fn run1() { 14async 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]
22async fn run2() { 22async 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]
29async fn run3() { 29async 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]
38async fn main(spawner: Spawner, _p: Peripherals) { 38async 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()));