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 /docs/modules/ROOT/examples/basic/src | |
| parent | 8745d646f0976791b7098456aa61adb983fb1c18 (diff) | |
Split embassy crate into embassy-executor, embassy-util.
Diffstat (limited to 'docs/modules/ROOT/examples/basic/src')
| -rw-r--r-- | docs/modules/ROOT/examples/basic/src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/modules/ROOT/examples/basic/src/main.rs b/docs/modules/ROOT/examples/basic/src/main.rs index 461741fd7..cec39fd91 100644 --- a/docs/modules/ROOT/examples/basic/src/main.rs +++ b/docs/modules/ROOT/examples/basic/src/main.rs | |||
| @@ -3,14 +3,14 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::time::{Duration, Timer}; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 8 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 9 | use embassy_nrf::peripherals::P0_13; | 9 | use embassy_nrf::peripherals::P0_13; |
| 10 | use embassy_nrf::Peripherals; | 10 | use embassy_nrf::Peripherals; |
| 11 | use {defmt_rtt as _, panic_probe as _}; // global logger | 11 | use {defmt_rtt as _, panic_probe as _}; // global logger |
| 12 | 12 | ||
| 13 | #[embassy::task] | 13 | #[embassy_executor::task] |
| 14 | async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { | 14 | async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { |
| 15 | loop { | 15 | loop { |
| 16 | led.set_high(); | 16 | led.set_high(); |
| @@ -20,7 +20,7 @@ async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { | |||
| 20 | } | 20 | } |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | #[embassy::main] | 23 | #[embassy_executor::main] |
| 24 | async fn main(spawner: Spawner, p: Peripherals) { | 24 | async fn main(spawner: Spawner, p: Peripherals) { |
| 25 | let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); | 25 | let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); |
| 26 | unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300)))); | 26 | unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300)))); |
