diff options
Diffstat (limited to 'examples')
192 files changed, 546 insertions, 521 deletions
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml index 0ae7163c3..dd9bcc093 100644 --- a/examples/boot/application/nrf/Cargo.toml +++ b/examples/boot/application/nrf/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-boot-nrf-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly"] } | 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util" } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly"] } | ||
| 8 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] } | 9 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] } |
| 9 | embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf" } | 10 | embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf" } |
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/nrf/src/bin/a.rs b/examples/boot/application/nrf/src/bin/a.rs index 0b9715e49..3044645a8 100644 --- a/examples/boot/application/nrf/src/bin/a.rs +++ b/examples/boot/application/nrf/src/bin/a.rs | |||
| @@ -13,8 +13,8 @@ use panic_reset as _; | |||
| 13 | 13 | ||
| 14 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 14 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy_executor::main] |
| 17 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 17 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 18 | let mut button = Input::new(p.P0_11, Pull::Up); | 18 | let mut button = Input::new(p.P0_11, Pull::Up); |
| 19 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); | 19 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); |
| 20 | //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); | 20 | //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); |
diff --git a/examples/boot/application/nrf/src/bin/b.rs b/examples/boot/application/nrf/src/bin/b.rs index a06c20f8b..2f76d20c6 100644 --- a/examples/boot/application/nrf/src/bin/b.rs +++ b/examples/boot/application/nrf/src/bin/b.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | #![feature(generic_associated_types)] | 4 | #![feature(generic_associated_types)] |
| 5 | #![feature(type_alias_impl_trait)] | 5 | #![feature(type_alias_impl_trait)] |
| 6 | 6 | ||
| 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; | 9 | use embassy_nrf::Peripherals; |
| 10 | use panic_reset as _; | 10 | use panic_reset as _; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 13 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 14 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); | 14 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); |
| 15 | //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); | 15 | //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); |
| 16 | 16 | ||
diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml index 36fc135fe..313808a0d 100644 --- a/examples/boot/application/stm32f3/Cargo.toml +++ b/examples/boot/application/stm32f3/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-boot-stm32f3-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } |
| 9 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } | 10 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs index 4ff18d7c7..fd18e9373 100644 --- a/examples/boot/application/stm32f3/src/bin/a.rs +++ b/examples/boot/application/stm32f3/src/bin/a.rs | |||
| @@ -14,8 +14,8 @@ use panic_reset as _; | |||
| 14 | 14 | ||
| 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 16 | 16 | ||
| 17 | #[embassy::main] | 17 | #[embassy_executor::main] |
| 18 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 18 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 19 | let flash = Flash::unlock(p.FLASH); | 19 | let flash = Flash::unlock(p.FLASH); |
| 20 | let mut flash = BlockingAsync::new(flash); | 20 | let mut flash = BlockingAsync::new(flash); |
| 21 | 21 | ||
diff --git a/examples/boot/application/stm32f3/src/bin/b.rs b/examples/boot/application/stm32f3/src/bin/b.rs index 4487e586e..934f862d9 100644 --- a/examples/boot/application/stm32f3/src/bin/b.rs +++ b/examples/boot/application/stm32f3/src/bin/b.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use panic_reset as _; | 11 | use panic_reset as _; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | let mut led = Output::new(p.PA5, Level::High, Speed::Low); | 15 | let mut led = Output::new(p.PA5, Level::High, Speed::Low); |
| 16 | 16 | ||
diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml index ad4a6fa76..2a4741dc7 100644 --- a/examples/boot/application/stm32f7/Cargo.toml +++ b/examples/boot/application/stm32f7/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-boot-stm32f7-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } |
| 9 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } | 10 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32f7/src/bin/a.rs b/examples/boot/application/stm32f7/src/bin/a.rs index 9c7921a1a..10d709cfd 100644 --- a/examples/boot/application/stm32f7/src/bin/a.rs +++ b/examples/boot/application/stm32f7/src/bin/a.rs | |||
| @@ -14,8 +14,8 @@ use panic_reset as _; | |||
| 14 | 14 | ||
| 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 16 | 16 | ||
| 17 | #[embassy::main] | 17 | #[embassy_executor::main] |
| 18 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 18 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 19 | let flash = Flash::unlock(p.FLASH); | 19 | let flash = Flash::unlock(p.FLASH); |
| 20 | let mut flash = BlockingAsync::new(flash); | 20 | let mut flash = BlockingAsync::new(flash); |
| 21 | 21 | ||
diff --git a/examples/boot/application/stm32f7/src/bin/b.rs b/examples/boot/application/stm32f7/src/bin/b.rs index aa05bbcdd..c89e8a310 100644 --- a/examples/boot/application/stm32f7/src/bin/b.rs +++ b/examples/boot/application/stm32f7/src/bin/b.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use panic_reset as _; | 11 | use panic_reset as _; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | Timer::after(Duration::from_millis(300)).await; | 15 | Timer::after(Duration::from_millis(300)).await; |
| 16 | let mut led = Output::new(p.PB7, Level::High, Speed::Low); | 16 | let mut led = Output::new(p.PB7, Level::High, Speed::Low); |
diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml index 5dff770a8..c6420e8ad 100644 --- a/examples/boot/application/stm32h7/Cargo.toml +++ b/examples/boot/application/stm32h7/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-boot-stm32h7-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } |
| 9 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } | 10 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs index 704979dba..cc363bb32 100644 --- a/examples/boot/application/stm32h7/src/bin/a.rs +++ b/examples/boot/application/stm32h7/src/bin/a.rs | |||
| @@ -14,8 +14,8 @@ use panic_reset as _; | |||
| 14 | 14 | ||
| 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 16 | 16 | ||
| 17 | #[embassy::main] | 17 | #[embassy_executor::main] |
| 18 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 18 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 19 | let flash = Flash::unlock(p.FLASH); | 19 | let flash = Flash::unlock(p.FLASH); |
| 20 | let mut flash = BlockingAsync::new(flash); | 20 | let mut flash = BlockingAsync::new(flash); |
| 21 | 21 | ||
diff --git a/examples/boot/application/stm32h7/src/bin/b.rs b/examples/boot/application/stm32h7/src/bin/b.rs index ea0140253..3fa63bdcf 100644 --- a/examples/boot/application/stm32h7/src/bin/b.rs +++ b/examples/boot/application/stm32h7/src/bin/b.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use panic_reset as _; | 11 | use panic_reset as _; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | Timer::after(Duration::from_millis(300)).await; | 15 | Timer::after(Duration::from_millis(300)).await; |
| 16 | let mut led = Output::new(p.PB14, Level::High, Speed::Low); | 16 | let mut led = Output::new(p.PB14, Level::High, Speed::Low); |
diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml index de7bea47b..a6936419c 100644 --- a/examples/boot/application/stm32l0/Cargo.toml +++ b/examples/boot/application/stm32l0/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-boot-stm32l0-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } |
| 9 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } | 10 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32l0/src/bin/a.rs b/examples/boot/application/stm32l0/src/bin/a.rs index ce620347b..fcf3f2ef1 100644 --- a/examples/boot/application/stm32l0/src/bin/a.rs +++ b/examples/boot/application/stm32l0/src/bin/a.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::time::{Duration, Timer}; | ||
| 8 | use embassy_boot_stm32::FirmwareUpdater; | 7 | use embassy_boot_stm32::FirmwareUpdater; |
| 9 | use embassy_embedded_hal::adapter::BlockingAsync; | 8 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 9 | use embassy_executor::time::{Duration, Timer}; | ||
| 10 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 11 | use embassy_stm32::flash::Flash; | 11 | use embassy_stm32::flash::Flash; |
| 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| @@ -15,8 +15,8 @@ use panic_reset as _; | |||
| 15 | 15 | ||
| 16 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 16 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 17 | 17 | ||
| 18 | #[embassy::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 19 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 20 | let flash = Flash::unlock(p.FLASH); | 20 | let flash = Flash::unlock(p.FLASH); |
| 21 | let mut flash = BlockingAsync::new(flash); | 21 | let mut flash = BlockingAsync::new(flash); |
| 22 | 22 | ||
diff --git a/examples/boot/application/stm32l0/src/bin/b.rs b/examples/boot/application/stm32l0/src/bin/b.rs index 0b585a14c..46e394c4c 100644 --- a/examples/boot/application/stm32l0/src/bin/b.rs +++ b/examples/boot/application/stm32l0/src/bin/b.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use panic_reset as _; | 11 | use panic_reset as _; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | let mut led = Output::new(p.PB6, Level::High, Speed::Low); | 15 | let mut led = Output::new(p.PB6, Level::High, Speed::Low); |
| 16 | 16 | ||
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml index 3fd6f639a..5e53cd5f6 100644 --- a/examples/boot/application/stm32l1/Cargo.toml +++ b/examples/boot/application/stm32l1/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-boot-stm32l1-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } |
| 9 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } | 10 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32l1/src/bin/a.rs b/examples/boot/application/stm32l1/src/bin/a.rs index ce620347b..fcf3f2ef1 100644 --- a/examples/boot/application/stm32l1/src/bin/a.rs +++ b/examples/boot/application/stm32l1/src/bin/a.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::time::{Duration, Timer}; | ||
| 8 | use embassy_boot_stm32::FirmwareUpdater; | 7 | use embassy_boot_stm32::FirmwareUpdater; |
| 9 | use embassy_embedded_hal::adapter::BlockingAsync; | 8 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 9 | use embassy_executor::time::{Duration, Timer}; | ||
| 10 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 11 | use embassy_stm32::flash::Flash; | 11 | use embassy_stm32::flash::Flash; |
| 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| @@ -15,8 +15,8 @@ use panic_reset as _; | |||
| 15 | 15 | ||
| 16 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 16 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 17 | 17 | ||
| 18 | #[embassy::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 19 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 20 | let flash = Flash::unlock(p.FLASH); | 20 | let flash = Flash::unlock(p.FLASH); |
| 21 | let mut flash = BlockingAsync::new(flash); | 21 | let mut flash = BlockingAsync::new(flash); |
| 22 | 22 | ||
diff --git a/examples/boot/application/stm32l1/src/bin/b.rs b/examples/boot/application/stm32l1/src/bin/b.rs index 0b585a14c..46e394c4c 100644 --- a/examples/boot/application/stm32l1/src/bin/b.rs +++ b/examples/boot/application/stm32l1/src/bin/b.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use panic_reset as _; | 11 | use panic_reset as _; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | let mut led = Output::new(p.PB6, Level::High, Speed::Low); | 15 | let mut led = Output::new(p.PB6, Level::High, Speed::Low); |
| 16 | 16 | ||
diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml index 7284af662..bbb5e7e1d 100644 --- a/examples/boot/application/stm32l4/Cargo.toml +++ b/examples/boot/application/stm32l4/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-boot-stm32l4-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } |
| 9 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } | 10 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs index bf6099355..f092f0239 100644 --- a/examples/boot/application/stm32l4/src/bin/a.rs +++ b/examples/boot/application/stm32l4/src/bin/a.rs | |||
| @@ -14,8 +14,8 @@ use panic_reset as _; | |||
| 14 | 14 | ||
| 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 16 | 16 | ||
| 17 | #[embassy::main] | 17 | #[embassy_executor::main] |
| 18 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 18 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 19 | let flash = Flash::unlock(p.FLASH); | 19 | let flash = Flash::unlock(p.FLASH); |
| 20 | let mut flash = BlockingAsync::new(flash); | 20 | let mut flash = BlockingAsync::new(flash); |
| 21 | 21 | ||
diff --git a/examples/boot/application/stm32l4/src/bin/b.rs b/examples/boot/application/stm32l4/src/bin/b.rs index 4487e586e..934f862d9 100644 --- a/examples/boot/application/stm32l4/src/bin/b.rs +++ b/examples/boot/application/stm32l4/src/bin/b.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use panic_reset as _; | 11 | use panic_reset as _; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | let mut led = Output::new(p.PA5, Level::High, Speed::Low); | 15 | let mut led = Output::new(p.PA5, Level::High, Speed::Low); |
| 16 | 16 | ||
diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml index ca22e6134..62123a870 100644 --- a/examples/boot/application/stm32wl/Cargo.toml +++ b/examples/boot/application/stm32wl/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-boot-stm32wl-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } |
| 9 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } | 10 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs index dc1eb9bed..14408a90a 100644 --- a/examples/boot/application/stm32wl/src/bin/a.rs +++ b/examples/boot/application/stm32wl/src/bin/a.rs | |||
| @@ -14,8 +14,8 @@ use panic_reset as _; | |||
| 14 | 14 | ||
| 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); | 15 | static APP_B: &[u8] = include_bytes!("../../b.bin"); |
| 16 | 16 | ||
| 17 | #[embassy::main] | 17 | #[embassy_executor::main] |
| 18 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | 18 | async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { |
| 19 | let flash = Flash::unlock(p.FLASH); | 19 | let flash = Flash::unlock(p.FLASH); |
| 20 | let mut flash = BlockingAsync::new(flash); | 20 | let mut flash = BlockingAsync::new(flash); |
| 21 | 21 | ||
diff --git a/examples/boot/application/stm32wl/src/bin/b.rs b/examples/boot/application/stm32wl/src/bin/b.rs index f2344bd53..e565fd7c6 100644 --- a/examples/boot/application/stm32wl/src/bin/b.rs +++ b/examples/boot/application/stm32wl/src/bin/b.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 5 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 6 | use defmt_rtt::*; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::gpio::{Level, Output, Speed}; | 9 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use panic_reset as _; | 11 | use panic_reset as _; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | let mut led = Output::new(p.PB15, Level::High, Speed::Low); | 15 | let mut led = Output::new(p.PB15, Level::High, Speed::Low); |
| 16 | 16 | ||
diff --git a/examples/boot/bootloader/nrf/Cargo.toml b/examples/boot/bootloader/nrf/Cargo.toml index 8eb98623c..9683bff19 100644 --- a/examples/boot/bootloader/nrf/Cargo.toml +++ b/examples/boot/bootloader/nrf/Cargo.toml | |||
| @@ -8,7 +8,6 @@ description = "Bootloader for nRF chips" | |||
| 8 | defmt = { version = "0.3", optional = true } | 8 | defmt = { version = "0.3", optional = true } |
| 9 | defmt-rtt = { version = "0.3", optional = true } | 9 | defmt-rtt = { version = "0.3", optional = true } |
| 10 | 10 | ||
| 11 | embassy = { path = "../../../../embassy", default-features = false } | ||
| 12 | embassy-nrf = { path = "../../../../embassy-nrf", default-features = false, features = ["nightly"] } | 11 | embassy-nrf = { path = "../../../../embassy-nrf", default-features = false, features = ["nightly"] } |
| 13 | embassy-boot-nrf = { path = "../../../../embassy-boot/nrf", default-features = false } | 12 | embassy-boot-nrf = { path = "../../../../embassy-boot/nrf", default-features = false } |
| 14 | cortex-m = { version = "0.7" } | 13 | cortex-m = { version = "0.7" } |
diff --git a/examples/boot/bootloader/stm32/Cargo.toml b/examples/boot/bootloader/stm32/Cargo.toml index b99a8fbcd..4a3319528 100644 --- a/examples/boot/bootloader/stm32/Cargo.toml +++ b/examples/boot/bootloader/stm32/Cargo.toml | |||
| @@ -8,7 +8,6 @@ description = "Example bootloader for STM32 chips" | |||
| 8 | defmt = { version = "0.3", optional = true } | 8 | defmt = { version = "0.3", optional = true } |
| 9 | defmt-rtt = { version = "0.3", optional = true } | 9 | defmt-rtt = { version = "0.3", optional = true } |
| 10 | 10 | ||
| 11 | embassy = { path = "../../../../embassy", default-features = false } | ||
| 12 | embassy-stm32 = { path = "../../../../embassy-stm32", default-features = false, features = ["nightly"] } | 11 | embassy-stm32 = { path = "../../../../embassy-stm32", default-features = false, features = ["nightly"] } |
| 13 | embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32", default-features = false } | 12 | embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32", default-features = false } |
| 14 | cortex-m = { version = "0.7" } | 13 | cortex-m = { version = "0.7" } |
diff --git a/examples/nrf/Cargo.toml b/examples/nrf/Cargo.toml index 0cba77694..91edbd36d 100644 --- a/examples/nrf/Cargo.toml +++ b/examples/nrf/Cargo.toml | |||
| @@ -5,10 +5,11 @@ version = "0.1.0" | |||
| 5 | 5 | ||
| 6 | [features] | 6 | [features] |
| 7 | default = ["nightly"] | 7 | default = ["nightly"] |
| 8 | nightly = ["embassy-nrf/nightly", "embassy-nrf/unstable-traits", "embassy-usb", "embassy-usb-serial", "embassy-usb-hid", "embassy-usb-ncm", "embedded-io/async", "embassy-net"] | 8 | nightly = ["embassy-executor/nightly", "embassy-nrf/nightly", "embassy-nrf/unstable-traits", "embassy-usb", "embassy-usb-serial", "embassy-usb-hid", "embassy-usb-ncm", "embedded-io/async", "embassy-net"] |
| 9 | 9 | ||
| 10 | [dependencies] | 10 | [dependencies] |
| 11 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] } | 11 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 12 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime"] } | ||
| 12 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } | 13 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
| 13 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"], optional = true } | 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"], optional = true } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"], optional = true } | 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"], optional = true } |
diff --git a/examples/nrf/src/bin/awaitable_timer.rs b/examples/nrf/src/bin/awaitable_timer.rs index 34a657cb9..f2c1d9fa4 100644 --- a/examples/nrf/src/bin/awaitable_timer.rs +++ b/examples/nrf/src/bin/awaitable_timer.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_nrf::timer::Timer; | 7 | use embassy_nrf::timer::Timer; |
| 8 | use embassy_nrf::{interrupt, Peripherals}; | 8 | use embassy_nrf::{interrupt, Peripherals}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 13 | let mut t = Timer::new_awaitable(p.TIMER0, interrupt::take!(TIMER0)); | 13 | let mut t = Timer::new_awaitable(p.TIMER0, interrupt::take!(TIMER0)); |
| 14 | // default frequency is 1MHz, so this triggers every second | 14 | // default frequency is 1MHz, so this triggers every second |
diff --git a/examples/nrf/src/bin/blinky.rs b/examples/nrf/src/bin/blinky.rs index 23d16f796..98db6546c 100644 --- a/examples/nrf/src/bin/blinky.rs +++ b/examples/nrf/src/bin/blinky.rs | |||
| @@ -2,13 +2,13 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use embassy::executor::Spawner; | 5 | use embassy_executor::executor::Spawner; |
| 6 | use embassy::time::{Duration, Timer}; | 6 | use embassy_executor::time::{Duration, Timer}; |
| 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 8 | use embassy_nrf::Peripherals; | 8 | use embassy_nrf::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 13 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); | 13 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); |
| 14 | 14 | ||
diff --git a/examples/nrf/src/bin/buffered_uart.rs b/examples/nrf/src/bin/buffered_uart.rs index 18dd698bf..f02b7d845 100644 --- a/examples/nrf/src/bin/buffered_uart.rs +++ b/examples/nrf/src/bin/buffered_uart.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_nrf::buffered_uarte::{BufferedUarte, State}; | 7 | use embassy_nrf::buffered_uarte::{BufferedUarte, State}; |
| 8 | use embassy_nrf::{interrupt, uarte, Peripherals}; | 8 | use embassy_nrf::{interrupt, uarte, Peripherals}; |
| 9 | use embedded_io::asynch::{BufRead, Write}; | 9 | use embedded_io::asynch::{BufRead, Write}; |
| 10 | use futures::pin_mut; | 10 | use futures::pin_mut; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | let mut config = uarte::Config::default(); | 15 | let mut config = uarte::Config::default(); |
| 16 | config.parity = uarte::Parity::EXCLUDED; | 16 | config.parity = uarte::Parity::EXCLUDED; |
diff --git a/examples/nrf/src/bin/channel.rs b/examples/nrf/src/bin/channel.rs index c57b91a42..e97c6c5ee 100644 --- a/examples/nrf/src/bin/channel.rs +++ b/examples/nrf/src/bin/channel.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy::blocking_mutex::raw::ThreadModeRawMutex; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::channel::mpmc::Channel; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy::executor::Spawner; | ||
| 9 | use embassy::time::{Duration, Timer}; | ||
| 10 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 8 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 11 | use embassy_nrf::Peripherals; | 9 | use embassy_nrf::Peripherals; |
| 10 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 11 | use embassy_util::channel::mpmc::Channel; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | enum LedState { | 14 | enum LedState { |
| @@ -18,7 +18,7 @@ enum LedState { | |||
| 18 | 18 | ||
| 19 | static CHANNEL: Channel<ThreadModeRawMutex, LedState, 1> = Channel::new(); | 19 | static CHANNEL: Channel<ThreadModeRawMutex, LedState, 1> = Channel::new(); |
| 20 | 20 | ||
| 21 | #[embassy::task] | 21 | #[embassy_executor::task] |
| 22 | async fn my_task() { | 22 | async fn my_task() { |
| 23 | loop { | 23 | loop { |
| 24 | CHANNEL.send(LedState::On).await; | 24 | CHANNEL.send(LedState::On).await; |
| @@ -28,7 +28,7 @@ async fn my_task() { | |||
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | #[embassy::main] | 31 | #[embassy_executor::main] |
| 32 | async fn main(spawner: Spawner, p: Peripherals) { | 32 | async fn main(spawner: Spawner, p: Peripherals) { |
| 33 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); | 33 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); |
| 34 | 34 | ||
diff --git a/examples/nrf/src/bin/channel_sender_receiver.rs b/examples/nrf/src/bin/channel_sender_receiver.rs index 847ce2382..bca7bb248 100644 --- a/examples/nrf/src/bin/channel_sender_receiver.rs +++ b/examples/nrf/src/bin/channel_sender_receiver.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy::blocking_mutex::raw::NoopRawMutex; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::channel::mpmc::{Channel, Receiver, Sender}; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy::executor::Spawner; | ||
| 9 | use embassy::time::{Duration, Timer}; | ||
| 10 | use embassy::util::Forever; | ||
| 11 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin}; | 8 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin}; |
| 12 | use embassy_nrf::Peripherals; | 9 | use embassy_nrf::Peripherals; |
| 10 | use embassy_util::blocking_mutex::raw::NoopRawMutex; | ||
| 11 | use embassy_util::channel::mpmc::{Channel, Receiver, Sender}; | ||
| 12 | use embassy_util::Forever; | ||
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | enum LedState { | 15 | enum LedState { |
| @@ -19,7 +19,7 @@ enum LedState { | |||
| 19 | 19 | ||
| 20 | static CHANNEL: Forever<Channel<NoopRawMutex, LedState, 1>> = Forever::new(); | 20 | static CHANNEL: Forever<Channel<NoopRawMutex, LedState, 1>> = Forever::new(); |
| 21 | 21 | ||
| 22 | #[embassy::task] | 22 | #[embassy_executor::task] |
| 23 | async fn send_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) { | 23 | async fn send_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) { |
| 24 | loop { | 24 | loop { |
| 25 | sender.send(LedState::On).await; | 25 | sender.send(LedState::On).await; |
| @@ -29,7 +29,7 @@ async fn send_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) { | |||
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | #[embassy::task] | 32 | #[embassy_executor::task] |
| 33 | async fn recv_task(led: AnyPin, receiver: Receiver<'static, NoopRawMutex, LedState, 1>) { | 33 | async fn recv_task(led: AnyPin, receiver: Receiver<'static, NoopRawMutex, LedState, 1>) { |
| 34 | let mut led = Output::new(led, Level::Low, OutputDrive::Standard); | 34 | let mut led = Output::new(led, Level::Low, OutputDrive::Standard); |
| 35 | 35 | ||
| @@ -41,7 +41,7 @@ async fn recv_task(led: AnyPin, receiver: Receiver<'static, NoopRawMutex, LedSta | |||
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | #[embassy::main] | 44 | #[embassy_executor::main] |
| 45 | async fn main(spawner: Spawner, p: Peripherals) { | 45 | async fn main(spawner: Spawner, p: Peripherals) { |
| 46 | let channel = CHANNEL.put(Channel::new()); | 46 | let channel = CHANNEL.put(Channel::new()); |
| 47 | 47 | ||
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())); |
diff --git a/examples/nrf/src/bin/gpiote_channel.rs b/examples/nrf/src/bin/gpiote_channel.rs index ad8f37c6e..65c7b4df7 100644 --- a/examples/nrf/src/bin/gpiote_channel.rs +++ b/examples/nrf/src/bin/gpiote_channel.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_nrf::gpio::{Input, Pull}; | 7 | use embassy_nrf::gpio::{Input, Pull}; |
| 8 | use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; | 8 | use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; |
| 9 | use embassy_nrf::Peripherals; | 9 | use embassy_nrf::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Starting!"); | 14 | info!("Starting!"); |
| 15 | 15 | ||
diff --git a/examples/nrf/src/bin/gpiote_port.rs b/examples/nrf/src/bin/gpiote_port.rs index 30b87b3a7..7746a7f96 100644 --- a/examples/nrf/src/bin/gpiote_port.rs +++ b/examples/nrf/src/bin/gpiote_port.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull}; | 7 | use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull}; |
| 8 | use embassy_nrf::Peripherals; | 8 | use embassy_nrf::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::task(pool_size = 4)] | 11 | #[embassy_executor::task(pool_size = 4)] |
| 12 | async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) { | 12 | async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) { |
| 13 | loop { | 13 | loop { |
| 14 | pin.wait_for_low().await; | 14 | pin.wait_for_low().await; |
| @@ -18,7 +18,7 @@ async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) { | |||
| 18 | } | 18 | } |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | #[embassy::main] | 21 | #[embassy_executor::main] |
| 22 | async fn main(spawner: Spawner, p: Peripherals) { | 22 | async fn main(spawner: Spawner, p: Peripherals) { |
| 23 | info!("Starting!"); | 23 | info!("Starting!"); |
| 24 | 24 | ||
diff --git a/examples/nrf/src/bin/multiprio.rs b/examples/nrf/src/bin/multiprio.rs index 1a4598e21..7050da378 100644 --- a/examples/nrf/src/bin/multiprio.rs +++ b/examples/nrf/src/bin/multiprio.rs | |||
| @@ -59,14 +59,14 @@ | |||
| 59 | 59 | ||
| 60 | use cortex_m_rt::entry; | 60 | use cortex_m_rt::entry; |
| 61 | use defmt::{info, unwrap}; | 61 | use defmt::{info, unwrap}; |
| 62 | use embassy::time::{Duration, Instant, Timer}; | 62 | use embassy_executor::time::{Duration, Instant, Timer}; |
| 63 | use embassy::util::Forever; | ||
| 64 | use embassy_nrf::executor::{Executor, InterruptExecutor}; | 63 | use embassy_nrf::executor::{Executor, InterruptExecutor}; |
| 65 | use embassy_nrf::interrupt; | 64 | use embassy_nrf::interrupt; |
| 66 | use embassy_nrf::interrupt::InterruptExt; | 65 | use embassy_nrf::interrupt::InterruptExt; |
| 66 | use embassy_util::Forever; | ||
| 67 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| 68 | 68 | ||
| 69 | #[embassy::task] | 69 | #[embassy_executor::task] |
| 70 | async fn run_high() { | 70 | async fn run_high() { |
| 71 | loop { | 71 | loop { |
| 72 | info!(" [high] tick!"); | 72 | info!(" [high] tick!"); |
| @@ -74,7 +74,7 @@ async fn run_high() { | |||
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | #[embassy::task] | 77 | #[embassy_executor::task] |
| 78 | async fn run_med() { | 78 | async fn run_med() { |
| 79 | loop { | 79 | loop { |
| 80 | let start = Instant::now(); | 80 | let start = Instant::now(); |
| @@ -91,7 +91,7 @@ async fn run_med() { | |||
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | #[embassy::task] | 94 | #[embassy_executor::task] |
| 95 | async fn run_low() { | 95 | async fn run_low() { |
| 96 | loop { | 96 | loop { |
| 97 | let start = Instant::now(); | 97 | let start = Instant::now(); |
diff --git a/examples/nrf/src/bin/mutex.rs b/examples/nrf/src/bin/mutex.rs index 92e01976c..5fe7eadb9 100644 --- a/examples/nrf/src/bin/mutex.rs +++ b/examples/nrf/src/bin/mutex.rs | |||
| @@ -3,16 +3,16 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::blocking_mutex::raw::ThreadModeRawMutex; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy::mutex::Mutex; | ||
| 9 | use embassy::time::{Duration, Timer}; | ||
| 10 | use embassy_nrf::Peripherals; | 8 | use embassy_nrf::Peripherals; |
| 9 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 10 | use embassy_util::mutex::Mutex; | ||
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0); | 13 | static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0); |
| 14 | 14 | ||
| 15 | #[embassy::task] | 15 | #[embassy_executor::task] |
| 16 | async fn my_task() { | 16 | async fn my_task() { |
| 17 | loop { | 17 | loop { |
| 18 | { | 18 | { |
| @@ -29,7 +29,7 @@ async fn my_task() { | |||
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | #[embassy::main] | 32 | #[embassy_executor::main] |
| 33 | async fn main(spawner: Spawner, _p: Peripherals) { | 33 | async fn main(spawner: Spawner, _p: Peripherals) { |
| 34 | unwrap!(spawner.spawn(my_task())); | 34 | unwrap!(spawner.spawn(my_task())); |
| 35 | 35 | ||
diff --git a/examples/nrf/src/bin/nvmc.rs b/examples/nrf/src/bin/nvmc.rs index b55ef1f6c..1d4387de7 100644 --- a/examples/nrf/src/bin/nvmc.rs +++ b/examples/nrf/src/bin/nvmc.rs | |||
| @@ -3,14 +3,14 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 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::nvmc::Nvmc; | 8 | use embassy_nrf::nvmc::Nvmc; |
| 9 | use embassy_nrf::Peripherals; | 9 | use embassy_nrf::Peripherals; |
| 10 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 10 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | info!("Hello NVMC!"); | 15 | info!("Hello NVMC!"); |
| 16 | 16 | ||
diff --git a/examples/nrf/src/bin/ppi.rs b/examples/nrf/src/bin/ppi.rs index 004a1bfa4..9a60cc0a0 100644 --- a/examples/nrf/src/bin/ppi.rs +++ b/examples/nrf/src/bin/ppi.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | use core::future::pending; | 5 | use core::future::pending; |
| 6 | 6 | ||
| 7 | use defmt::info; | 7 | use defmt::info; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull}; | 9 | use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull}; |
| 10 | use embassy_nrf::gpiote::{self, InputChannel, InputChannelPolarity}; | 10 | use embassy_nrf::gpiote::{self, InputChannel, InputChannelPolarity}; |
| 11 | use embassy_nrf::ppi::Ppi; | 11 | use embassy_nrf::ppi::Ppi; |
| @@ -13,7 +13,7 @@ use embassy_nrf::Peripherals; | |||
| 13 | use gpiote::{OutputChannel, OutputChannelPolarity}; | 13 | use gpiote::{OutputChannel, OutputChannelPolarity}; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy_executor::main] |
| 17 | async fn main(_spawner: Spawner, p: Peripherals) { | 17 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 18 | info!("Starting!"); | 18 | info!("Starting!"); |
| 19 | 19 | ||
diff --git a/examples/nrf/src/bin/pubsub.rs b/examples/nrf/src/bin/pubsub.rs index 2c3a355c2..5f33f3e0b 100644 --- a/examples/nrf/src/bin/pubsub.rs +++ b/examples/nrf/src/bin/pubsub.rs | |||
| @@ -3,10 +3,10 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy::blocking_mutex::raw::ThreadModeRawMutex; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::channel::pubsub::{DynSubscriber, PubSubChannel, Subscriber}; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; |
| 9 | use embassy::time::{Duration, Timer}; | 9 | use embassy_util::channel::pubsub::{DynSubscriber, PubSubChannel, Subscriber}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | /// Create the message bus. It has a queue of 4, supports 3 subscribers and 1 publisher | 12 | /// Create the message bus. It has a queue of 4, supports 3 subscribers and 1 publisher |
| @@ -19,7 +19,7 @@ enum Message { | |||
| 19 | C, | 19 | C, |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | #[embassy::main] | 22 | #[embassy_executor::main] |
| 23 | async fn main(spawner: Spawner, _p: embassy_nrf::Peripherals) { | 23 | async fn main(spawner: Spawner, _p: embassy_nrf::Peripherals) { |
| 24 | defmt::info!("Hello World!"); | 24 | defmt::info!("Hello World!"); |
| 25 | 25 | ||
| @@ -64,7 +64,7 @@ async fn main(spawner: Spawner, _p: embassy_nrf::Peripherals) { | |||
| 64 | /// A logger task that just awaits the messages it receives | 64 | /// A logger task that just awaits the messages it receives |
| 65 | /// | 65 | /// |
| 66 | /// This takes the generic `Subscriber`. This is most performant, but requires you to write down all of the generics | 66 | /// This takes the generic `Subscriber`. This is most performant, but requires you to write down all of the generics |
| 67 | #[embassy::task] | 67 | #[embassy_executor::task] |
| 68 | async fn fast_logger(mut messages: Subscriber<'static, ThreadModeRawMutex, Message, 4, 3, 1>) { | 68 | async fn fast_logger(mut messages: Subscriber<'static, ThreadModeRawMutex, Message, 4, 3, 1>) { |
| 69 | loop { | 69 | loop { |
| 70 | let message = messages.next_message().await; | 70 | let message = messages.next_message().await; |
| @@ -76,7 +76,7 @@ async fn fast_logger(mut messages: Subscriber<'static, ThreadModeRawMutex, Messa | |||
| 76 | /// Because of this, depeding on how the messages were published, the subscriber might miss some messages | 76 | /// Because of this, depeding on how the messages were published, the subscriber might miss some messages |
| 77 | /// | 77 | /// |
| 78 | /// This takes the dynamic `DynSubscriber`. This is not as performant as the generic version, but let's you ignore some of the generics | 78 | /// This takes the dynamic `DynSubscriber`. This is not as performant as the generic version, but let's you ignore some of the generics |
| 79 | #[embassy::task] | 79 | #[embassy_executor::task] |
| 80 | async fn slow_logger(mut messages: DynSubscriber<'static, Message>) { | 80 | async fn slow_logger(mut messages: DynSubscriber<'static, Message>) { |
| 81 | loop { | 81 | loop { |
| 82 | // Do some work | 82 | // Do some work |
| @@ -93,7 +93,7 @@ async fn slow_logger(mut messages: DynSubscriber<'static, Message>) { | |||
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | /// Same as `slow_logger` but it ignores lag results | 95 | /// Same as `slow_logger` but it ignores lag results |
| 96 | #[embassy::task] | 96 | #[embassy_executor::task] |
| 97 | async fn slow_logger_pure(mut messages: DynSubscriber<'static, Message>) { | 97 | async fn slow_logger_pure(mut messages: DynSubscriber<'static, Message>) { |
| 98 | loop { | 98 | loop { |
| 99 | // Do some work | 99 | // Do some work |
diff --git a/examples/nrf/src/bin/pwm.rs b/examples/nrf/src/bin/pwm.rs index aec5dd73a..c8a083294 100644 --- a/examples/nrf/src/bin/pwm.rs +++ b/examples/nrf/src/bin/pwm.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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::pwm::{Prescaler, SimplePwm}; | 8 | use embassy_nrf::pwm::{Prescaler, SimplePwm}; |
| 9 | use embassy_nrf::Peripherals; | 9 | use embassy_nrf::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -70,7 +70,7 @@ static DUTY: [u16; 1024] = [ | |||
| 70 | 7255, 7331, 7407, 7484, 7561, 7638, 7716, 7794, 7873, 7952, 8031, 8111, | 70 | 7255, 7331, 7407, 7484, 7561, 7638, 7716, 7794, 7873, 7952, 8031, 8111, |
| 71 | ]; | 71 | ]; |
| 72 | 72 | ||
| 73 | #[embassy::main] | 73 | #[embassy_executor::main] |
| 74 | async fn main(_spawner: Spawner, p: Peripherals) { | 74 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 75 | let mut pwm = SimplePwm::new_4ch(p.PWM0, p.P0_13, p.P0_14, p.P0_16, p.P0_15); | 75 | let mut pwm = SimplePwm::new_4ch(p.PWM0, p.P0_13, p.P0_14, p.P0_16, p.P0_15); |
| 76 | pwm.set_prescaler(Prescaler::Div1); | 76 | pwm.set_prescaler(Prescaler::Div1); |
diff --git a/examples/nrf/src/bin/pwm_double_sequence.rs b/examples/nrf/src/bin/pwm_double_sequence.rs index facafa775..cfd8db86b 100644 --- a/examples/nrf/src/bin/pwm_double_sequence.rs +++ b/examples/nrf/src/bin/pwm_double_sequence.rs | |||
| @@ -3,15 +3,15 @@ | |||
| 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::pwm::{ | 8 | use embassy_nrf::pwm::{ |
| 9 | Config, Prescaler, Sequence, SequenceConfig, SequenceMode, SequencePwm, Sequencer, StartSequence, | 9 | Config, Prescaler, Sequence, SequenceConfig, SequenceMode, SequencePwm, Sequencer, StartSequence, |
| 10 | }; | 10 | }; |
| 11 | use embassy_nrf::Peripherals; | 11 | use embassy_nrf::Peripherals; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | #[embassy::main] | 14 | #[embassy_executor::main] |
| 15 | async fn main(_spawner: Spawner, p: Peripherals) { | 15 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 16 | let seq_words_0: [u16; 5] = [1000, 250, 100, 50, 0]; | 16 | let seq_words_0: [u16; 5] = [1000, 250, 100, 50, 0]; |
| 17 | let seq_words_1: [u16; 4] = [50, 100, 250, 1000]; | 17 | let seq_words_1: [u16; 4] = [50, 100, 250, 1000]; |
diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs index b7cb385c7..b7a04c036 100644 --- a/examples/nrf/src/bin/pwm_sequence.rs +++ b/examples/nrf/src/bin/pwm_sequence.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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::pwm::{Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer}; | 8 | use embassy_nrf::pwm::{Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer}; |
| 9 | use embassy_nrf::Peripherals; | 9 | use embassy_nrf::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | let seq_words: [u16; 5] = [1000, 250, 100, 50, 0]; | 14 | let seq_words: [u16; 5] = [1000, 250, 100, 50, 0]; |
| 15 | 15 | ||
diff --git a/examples/nrf/src/bin/pwm_sequence_ppi.rs b/examples/nrf/src/bin/pwm_sequence_ppi.rs index d98e2ca76..f5c587c35 100644 --- a/examples/nrf/src/bin/pwm_sequence_ppi.rs +++ b/examples/nrf/src/bin/pwm_sequence_ppi.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | use core::future::pending; | 5 | use core::future::pending; |
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy_nrf::gpio::{Input, Pull}; | 9 | use embassy_nrf::gpio::{Input, Pull}; |
| 10 | use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; | 10 | use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; |
| 11 | use embassy_nrf::ppi::Ppi; | 11 | use embassy_nrf::ppi::Ppi; |
| @@ -13,7 +13,7 @@ use embassy_nrf::pwm::{Config, Prescaler, SequenceConfig, SequencePwm, SingleSeq | |||
| 13 | use embassy_nrf::Peripherals; | 13 | use embassy_nrf::Peripherals; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy_executor::main] |
| 17 | async fn main(_spawner: Spawner, p: Peripherals) { | 17 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 18 | let seq_words: [u16; 5] = [1000, 250, 100, 50, 0]; | 18 | let seq_words: [u16; 5] = [1000, 250, 100, 50, 0]; |
| 19 | 19 | ||
diff --git a/examples/nrf/src/bin/pwm_sequence_ws2812b.rs b/examples/nrf/src/bin/pwm_sequence_ws2812b.rs index 0dee8c949..d6b3f005c 100644 --- a/examples/nrf/src/bin/pwm_sequence_ws2812b.rs +++ b/examples/nrf/src/bin/pwm_sequence_ws2812b.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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::pwm::{ | 8 | use embassy_nrf::pwm::{ |
| 9 | Config, Prescaler, SequenceConfig, SequenceLoad, SequencePwm, SingleSequenceMode, SingleSequencer, | 9 | Config, Prescaler, SequenceConfig, SequenceLoad, SequencePwm, SingleSequenceMode, SingleSequencer, |
| 10 | }; | 10 | }; |
| @@ -26,7 +26,7 @@ const RES: u16 = 0x8000; | |||
| 26 | 26 | ||
| 27 | // Provides data to a WS2812b (Neopixel) LED and makes it go blue. The data | 27 | // Provides data to a WS2812b (Neopixel) LED and makes it go blue. The data |
| 28 | // line is assumed to be P1_05. | 28 | // line is assumed to be P1_05. |
| 29 | #[embassy::main] | 29 | #[embassy_executor::main] |
| 30 | async fn main(_spawner: Spawner, p: Peripherals) { | 30 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 31 | let mut config = Config::default(); | 31 | let mut config = Config::default(); |
| 32 | config.sequence_load = SequenceLoad::Common; | 32 | config.sequence_load = SequenceLoad::Common; |
diff --git a/examples/nrf/src/bin/pwm_servo.rs b/examples/nrf/src/bin/pwm_servo.rs index 71a90a948..d28a5a17e 100644 --- a/examples/nrf/src/bin/pwm_servo.rs +++ b/examples/nrf/src/bin/pwm_servo.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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::pwm::{Prescaler, SimplePwm}; | 8 | use embassy_nrf::pwm::{Prescaler, SimplePwm}; |
| 9 | use embassy_nrf::Peripherals; | 9 | use embassy_nrf::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | let mut pwm = SimplePwm::new_1ch(p.PWM0, p.P0_05); | 14 | let mut pwm = SimplePwm::new_1ch(p.PWM0, p.P0_05); |
| 15 | // sg90 microervo requires 50hz or 20ms period | 15 | // sg90 microervo requires 50hz or 20ms period |
diff --git a/examples/nrf/src/bin/qdec.rs b/examples/nrf/src/bin/qdec.rs index 9529c7bb6..6bda82f78 100644 --- a/examples/nrf/src/bin/qdec.rs +++ b/examples/nrf/src/bin/qdec.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_nrf::qdec::{self, Qdec}; | 7 | use embassy_nrf::qdec::{self, Qdec}; |
| 8 | use embassy_nrf::{interrupt, Peripherals}; | 8 | use embassy_nrf::{interrupt, Peripherals}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 13 | let irq = interrupt::take!(QDEC); | 13 | let irq = interrupt::take!(QDEC); |
| 14 | let config = qdec::Config::default(); | 14 | let config = qdec::Config::default(); |
diff --git a/examples/nrf/src/bin/qspi.rs b/examples/nrf/src/bin/qspi.rs index 96c90f9c8..57e0fdbe2 100644 --- a/examples/nrf/src/bin/qspi.rs +++ b/examples/nrf/src/bin/qspi.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{assert_eq, info, unwrap}; | 5 | use defmt::{assert_eq, info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_nrf::{interrupt, qspi, Peripherals}; | 7 | use embassy_nrf::{interrupt, qspi, Peripherals}; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
| @@ -14,7 +14,7 @@ const PAGE_SIZE: usize = 4096; | |||
| 14 | #[repr(C, align(4))] | 14 | #[repr(C, align(4))] |
| 15 | struct AlignedBuf([u8; 4096]); | 15 | struct AlignedBuf([u8; 4096]); |
| 16 | 16 | ||
| 17 | #[embassy::main] | 17 | #[embassy_executor::main] |
| 18 | async fn main(_spawner: Spawner, p: Peripherals) { | 18 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 19 | // Config for the MX25R64 present in the nRF52840 DK | 19 | // Config for the MX25R64 present in the nRF52840 DK |
| 20 | let mut config = qspi::Config::default(); | 20 | let mut config = qspi::Config::default(); |
diff --git a/examples/nrf/src/bin/qspi_lowpower.rs b/examples/nrf/src/bin/qspi_lowpower.rs index ce2e40b23..080b27a16 100644 --- a/examples/nrf/src/bin/qspi_lowpower.rs +++ b/examples/nrf/src/bin/qspi_lowpower.rs | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | use core::mem; | 5 | use core::mem; |
| 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, Timer}; | 9 | use embassy_executor::time::{Duration, Timer}; |
| 10 | use embassy_nrf::{interrupt, qspi, Peripherals}; | 10 | use embassy_nrf::{interrupt, qspi, Peripherals}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| @@ -15,7 +15,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 15 | #[repr(C, align(4))] | 15 | #[repr(C, align(4))] |
| 16 | struct AlignedBuf([u8; 64]); | 16 | struct AlignedBuf([u8; 64]); |
| 17 | 17 | ||
| 18 | #[embassy::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(_spawner: Spawner, mut p: Peripherals) { | 19 | async fn main(_spawner: Spawner, mut p: Peripherals) { |
| 20 | let mut irq = interrupt::take!(QSPI); | 20 | let mut irq = interrupt::take!(QSPI); |
| 21 | 21 | ||
diff --git a/examples/nrf/src/bin/raw_spawn.rs b/examples/nrf/src/bin/raw_spawn.rs index d564b6b26..9199d3aeb 100644 --- a/examples/nrf/src/bin/raw_spawn.rs +++ b/examples/nrf/src/bin/raw_spawn.rs | |||
| @@ -5,10 +5,10 @@ use core::mem; | |||
| 5 | 5 | ||
| 6 | use cortex_m_rt::entry; | 6 | use cortex_m_rt::entry; |
| 7 | use defmt::{info, unwrap}; | 7 | use defmt::{info, unwrap}; |
| 8 | use embassy::executor::raw::TaskStorage; | 8 | use embassy_executor::executor::raw::TaskStorage; |
| 9 | use embassy::executor::Executor; | 9 | use embassy_executor::executor::Executor; |
| 10 | use embassy::time::{Duration, Timer}; | 10 | use embassy_executor::time::{Duration, Timer}; |
| 11 | use embassy::util::Forever; | 11 | use embassy_util::Forever; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | async fn run1() { | 14 | async fn run1() { |
diff --git a/examples/nrf/src/bin/rng.rs b/examples/nrf/src/bin/rng.rs index 08d3abe10..a4314e8b9 100644 --- a/examples/nrf/src/bin/rng.rs +++ b/examples/nrf/src/bin/rng.rs | |||
| @@ -2,13 +2,13 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use embassy::executor::Spawner; | 5 | use embassy_executor::executor::Spawner; |
| 6 | use embassy_nrf::rng::Rng; | 6 | use embassy_nrf::rng::Rng; |
| 7 | use embassy_nrf::{interrupt, Peripherals}; | 7 | use embassy_nrf::{interrupt, Peripherals}; |
| 8 | use rand::Rng as _; | 8 | use rand::Rng as _; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 13 | let mut rng = Rng::new(p.RNG, interrupt::take!(RNG)); | 13 | let mut rng = Rng::new(p.RNG, interrupt::take!(RNG)); |
| 14 | 14 | ||
diff --git a/examples/nrf/src/bin/saadc.rs b/examples/nrf/src/bin/saadc.rs index cb9289784..65c78d842 100644 --- a/examples/nrf/src/bin/saadc.rs +++ b/examples/nrf/src/bin/saadc.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 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::saadc::{ChannelConfig, Config, Saadc}; | 8 | use embassy_nrf::saadc::{ChannelConfig, Config, Saadc}; |
| 9 | use embassy_nrf::{interrupt, Peripherals}; | 9 | use embassy_nrf::{interrupt, Peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, mut p: Peripherals) { | 13 | async fn main(_spawner: Spawner, mut p: Peripherals) { |
| 14 | let config = Config::default(); | 14 | let config = Config::default(); |
| 15 | let channel_config = ChannelConfig::single_ended(&mut p.P0_02); | 15 | let channel_config = ChannelConfig::single_ended(&mut p.P0_02); |
diff --git a/examples/nrf/src/bin/saadc_continuous.rs b/examples/nrf/src/bin/saadc_continuous.rs index 234294eae..d0305736f 100644 --- a/examples/nrf/src/bin/saadc_continuous.rs +++ b/examples/nrf/src/bin/saadc_continuous.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::time::Duration; | 7 | use embassy_executor::time::Duration; |
| 8 | use embassy_nrf::saadc::{ChannelConfig, Config, Saadc, SamplerState}; | 8 | use embassy_nrf::saadc::{ChannelConfig, Config, Saadc, SamplerState}; |
| 9 | use embassy_nrf::timer::Frequency; | 9 | use embassy_nrf::timer::Frequency; |
| 10 | use embassy_nrf::{interrupt, Peripherals}; | 10 | use embassy_nrf::{interrupt, Peripherals}; |
| @@ -12,7 +12,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 12 | 12 | ||
| 13 | // Demonstrates both continuous sampling and scanning multiple channels driven by a PPI linked timer | 13 | // Demonstrates both continuous sampling and scanning multiple channels driven by a PPI linked timer |
| 14 | 14 | ||
| 15 | #[embassy::main] | 15 | #[embassy_executor::main] |
| 16 | async fn main(_spawner: Spawner, mut p: Peripherals) { | 16 | async fn main(_spawner: Spawner, mut p: Peripherals) { |
| 17 | let config = Config::default(); | 17 | let config = Config::default(); |
| 18 | let channel_1_config = ChannelConfig::single_ended(&mut p.P0_02); | 18 | let channel_1_config = ChannelConfig::single_ended(&mut p.P0_02); |
| @@ -27,7 +27,7 @@ async fn main(_spawner: Spawner, mut p: Peripherals) { | |||
| 27 | 27 | ||
| 28 | // This delay demonstrates that starting the timer prior to running | 28 | // This delay demonstrates that starting the timer prior to running |
| 29 | // the task sampler is benign given the calibration that follows. | 29 | // the task sampler is benign given the calibration that follows. |
| 30 | embassy::time::Timer::after(Duration::from_millis(500)).await; | 30 | embassy_executor::time::Timer::after(Duration::from_millis(500)).await; |
| 31 | saadc.calibrate().await; | 31 | saadc.calibrate().await; |
| 32 | 32 | ||
| 33 | let mut bufs = [[[0; 3]; 500]; 2]; | 33 | let mut bufs = [[[0; 3]; 500]; 2]; |
diff --git a/examples/nrf/src/bin/self_spawn.rs b/examples/nrf/src/bin/self_spawn.rs index 4b8ac04bc..e0152802e 100644 --- a/examples/nrf/src/bin/self_spawn.rs +++ b/examples/nrf/src/bin/self_spawn.rs | |||
| @@ -3,19 +3,19 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 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::Peripherals; | 8 | use embassy_nrf::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::task(pool_size = 2)] | 11 | #[embassy_executor::task(pool_size = 2)] |
| 12 | async fn my_task(spawner: Spawner, n: u32) { | 12 | async fn my_task(spawner: Spawner, n: u32) { |
| 13 | Timer::after(Duration::from_secs(1)).await; | 13 | Timer::after(Duration::from_secs(1)).await; |
| 14 | info!("Spawning self! {}", n); | 14 | info!("Spawning self! {}", n); |
| 15 | unwrap!(spawner.spawn(my_task(spawner, n + 1))); | 15 | unwrap!(spawner.spawn(my_task(spawner, n + 1))); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(spawner: Spawner, _p: Peripherals) { | 19 | async fn main(spawner: Spawner, _p: Peripherals) { |
| 20 | info!("Hello World!"); | 20 | info!("Hello World!"); |
| 21 | unwrap!(spawner.spawn(my_task(spawner, 0))); | 21 | unwrap!(spawner.spawn(my_task(spawner, 0))); |
diff --git a/examples/nrf/src/bin/self_spawn_current_executor.rs b/examples/nrf/src/bin/self_spawn_current_executor.rs index 3c3379ce6..1d8309d77 100644 --- a/examples/nrf/src/bin/self_spawn_current_executor.rs +++ b/examples/nrf/src/bin/self_spawn_current_executor.rs | |||
| @@ -3,19 +3,19 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 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::Peripherals; | 8 | use embassy_nrf::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::task(pool_size = 2)] | 11 | #[embassy_executor::task(pool_size = 2)] |
| 12 | async fn my_task(n: u32) { | 12 | async fn my_task(n: u32) { |
| 13 | Timer::after(Duration::from_secs(1)).await; | 13 | Timer::after(Duration::from_secs(1)).await; |
| 14 | info!("Spawning self! {}", n); | 14 | info!("Spawning self! {}", n); |
| 15 | unwrap!(Spawner::for_current_executor().await.spawn(my_task(n + 1))); | 15 | unwrap!(Spawner::for_current_executor().await.spawn(my_task(n + 1))); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(spawner: Spawner, _p: Peripherals) { | 19 | async fn main(spawner: Spawner, _p: Peripherals) { |
| 20 | info!("Hello World!"); | 20 | info!("Hello World!"); |
| 21 | unwrap!(spawner.spawn(my_task(0))); | 21 | unwrap!(spawner.spawn(my_task(0))); |
diff --git a/examples/nrf/src/bin/spim.rs b/examples/nrf/src/bin/spim.rs index 62040168a..fd741b21c 100644 --- a/examples/nrf/src/bin/spim.rs +++ b/examples/nrf/src/bin/spim.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 8 | use embassy_nrf::{interrupt, spim, Peripherals}; | 8 | use embassy_nrf::{interrupt, spim, Peripherals}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 13 | info!("running!"); | 13 | info!("running!"); |
| 14 | 14 | ||
diff --git a/examples/nrf/src/bin/temp.rs b/examples/nrf/src/bin/temp.rs index 939cb39e7..654098e0b 100644 --- a/examples/nrf/src/bin/temp.rs +++ b/examples/nrf/src/bin/temp.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 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::temp::Temp; | 8 | use embassy_nrf::temp::Temp; |
| 9 | use embassy_nrf::{interrupt, Peripherals}; | 9 | use embassy_nrf::{interrupt, Peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | let irq = interrupt::take!(TEMP); | 14 | let irq = interrupt::take!(TEMP); |
| 15 | let mut temp = Temp::new(p.TEMP, irq); | 15 | let mut temp = Temp::new(p.TEMP, irq); |
diff --git a/examples/nrf/src/bin/timer.rs b/examples/nrf/src/bin/timer.rs index 64376dd78..61ff1d6db 100644 --- a/examples/nrf/src/bin/timer.rs +++ b/examples/nrf/src/bin/timer.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 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::Peripherals; | 8 | use embassy_nrf::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::task] | 11 | #[embassy_executor::task] |
| 12 | async fn run1() { | 12 | async fn run1() { |
| 13 | loop { | 13 | loop { |
| 14 | info!("BIG INFREQUENT TICK"); | 14 | info!("BIG INFREQUENT TICK"); |
| @@ -16,7 +16,7 @@ async fn run1() { | |||
| 16 | } | 16 | } |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | #[embassy::task] | 19 | #[embassy_executor::task] |
| 20 | async fn run2() { | 20 | async fn run2() { |
| 21 | loop { | 21 | loop { |
| 22 | info!("tick"); | 22 | info!("tick"); |
| @@ -24,7 +24,7 @@ async fn run2() { | |||
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy::main] | 27 | #[embassy_executor::main] |
| 28 | async fn main(spawner: Spawner, _p: Peripherals) { | 28 | async fn main(spawner: Spawner, _p: Peripherals) { |
| 29 | unwrap!(spawner.spawn(run1())); | 29 | unwrap!(spawner.spawn(run1())); |
| 30 | unwrap!(spawner.spawn(run2())); | 30 | unwrap!(spawner.spawn(run2())); |
diff --git a/examples/nrf/src/bin/twim.rs b/examples/nrf/src/bin/twim.rs index fb8372a12..bb7ee9db4 100644 --- a/examples/nrf/src/bin/twim.rs +++ b/examples/nrf/src/bin/twim.rs | |||
| @@ -7,14 +7,14 @@ | |||
| 7 | #![feature(type_alias_impl_trait)] | 7 | #![feature(type_alias_impl_trait)] |
| 8 | 8 | ||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy::executor::Spawner; | 10 | use embassy_executor::executor::Spawner; |
| 11 | use embassy_nrf::twim::{self, Twim}; | 11 | use embassy_nrf::twim::{self, Twim}; |
| 12 | use embassy_nrf::{interrupt, Peripherals}; | 12 | use embassy_nrf::{interrupt, Peripherals}; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | const ADDRESS: u8 = 0x50; | 15 | const ADDRESS: u8 = 0x50; |
| 16 | 16 | ||
| 17 | #[embassy::main] | 17 | #[embassy_executor::main] |
| 18 | async fn main(_spawner: Spawner, p: Peripherals) { | 18 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 19 | info!("Initializing TWI..."); | 19 | info!("Initializing TWI..."); |
| 20 | let config = twim::Config::default(); | 20 | let config = twim::Config::default(); |
diff --git a/examples/nrf/src/bin/twim_lowpower.rs b/examples/nrf/src/bin/twim_lowpower.rs index c9c2d503e..ebf3d7109 100644 --- a/examples/nrf/src/bin/twim_lowpower.rs +++ b/examples/nrf/src/bin/twim_lowpower.rs | |||
| @@ -11,15 +11,15 @@ | |||
| 11 | use core::mem; | 11 | use core::mem; |
| 12 | 12 | ||
| 13 | use defmt::*; | 13 | use defmt::*; |
| 14 | use embassy::executor::Spawner; | 14 | use embassy_executor::executor::Spawner; |
| 15 | use embassy::time::{Duration, Timer}; | 15 | use embassy_executor::time::{Duration, Timer}; |
| 16 | use embassy_nrf::twim::{self, Twim}; | 16 | use embassy_nrf::twim::{self, Twim}; |
| 17 | use embassy_nrf::{interrupt, Peripherals}; | 17 | use embassy_nrf::{interrupt, Peripherals}; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | 19 | ||
| 20 | const ADDRESS: u8 = 0x50; | 20 | const ADDRESS: u8 = 0x50; |
| 21 | 21 | ||
| 22 | #[embassy::main] | 22 | #[embassy_executor::main] |
| 23 | async fn main(_spawner: Spawner, mut p: Peripherals) { | 23 | async fn main(_spawner: Spawner, mut p: Peripherals) { |
| 24 | info!("Started!"); | 24 | info!("Started!"); |
| 25 | let mut irq = interrupt::take!(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0); | 25 | let mut irq = interrupt::take!(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0); |
diff --git a/examples/nrf/src/bin/uart.rs b/examples/nrf/src/bin/uart.rs index c8c4a67a5..5f363b69e 100644 --- a/examples/nrf/src/bin/uart.rs +++ b/examples/nrf/src/bin/uart.rs | |||
| @@ -3,11 +3,11 @@ | |||
| 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_nrf::{interrupt, uarte, Peripherals}; | 7 | use embassy_nrf::{interrupt, uarte, Peripherals}; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
| 10 | #[embassy::main] | 10 | #[embassy_executor::main] |
| 11 | async fn main(_spawner: Spawner, p: Peripherals) { | 11 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 12 | let mut config = uarte::Config::default(); | 12 | let mut config = uarte::Config::default(); |
| 13 | config.parity = uarte::Parity::EXCLUDED; | 13 | config.parity = uarte::Parity::EXCLUDED; |
diff --git a/examples/nrf/src/bin/uart_idle.rs b/examples/nrf/src/bin/uart_idle.rs index 6679b28da..0f455dffd 100644 --- a/examples/nrf/src/bin/uart_idle.rs +++ b/examples/nrf/src/bin/uart_idle.rs | |||
| @@ -3,11 +3,11 @@ | |||
| 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_nrf::{interrupt, uarte, Peripherals}; | 7 | use embassy_nrf::{interrupt, uarte, Peripherals}; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
| 10 | #[embassy::main] | 10 | #[embassy_executor::main] |
| 11 | async fn main(_spawner: Spawner, p: Peripherals) { | 11 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 12 | let mut config = uarte::Config::default(); | 12 | let mut config = uarte::Config::default(); |
| 13 | config.parity = uarte::Parity::EXCLUDED; | 13 | config.parity = uarte::Parity::EXCLUDED; |
diff --git a/examples/nrf/src/bin/uart_split.rs b/examples/nrf/src/bin/uart_split.rs index 1ffb63706..2de5f90c1 100644 --- a/examples/nrf/src/bin/uart_split.rs +++ b/examples/nrf/src/bin/uart_split.rs | |||
| @@ -3,17 +3,17 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy::blocking_mutex::raw::ThreadModeRawMutex; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::channel::mpmc::Channel; | ||
| 8 | use embassy::executor::Spawner; | ||
| 9 | use embassy_nrf::peripherals::UARTE0; | 7 | use embassy_nrf::peripherals::UARTE0; |
| 10 | use embassy_nrf::uarte::UarteRx; | 8 | use embassy_nrf::uarte::UarteRx; |
| 11 | use embassy_nrf::{interrupt, uarte, Peripherals}; | 9 | use embassy_nrf::{interrupt, uarte, Peripherals}; |
| 10 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 11 | use embassy_util::channel::mpmc::Channel; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); | 14 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); |
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy_executor::main] |
| 17 | async fn main(spawner: Spawner, p: Peripherals) { | 17 | async fn main(spawner: Spawner, p: Peripherals) { |
| 18 | let mut config = uarte::Config::default(); | 18 | let mut config = uarte::Config::default(); |
| 19 | config.parity = uarte::Parity::EXCLUDED; | 19 | config.parity = uarte::Parity::EXCLUDED; |
| @@ -48,7 +48,7 @@ async fn main(spawner: Spawner, p: Peripherals) { | |||
| 48 | } | 48 | } |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | #[embassy::task] | 51 | #[embassy_executor::task] |
| 52 | async fn reader(mut rx: UarteRx<'static, UARTE0>) { | 52 | async fn reader(mut rx: UarteRx<'static, UARTE0>) { |
| 53 | let mut buf = [0; 8]; | 53 | let mut buf = [0; 8]; |
| 54 | loop { | 54 | loop { |
diff --git a/examples/nrf/src/bin/usb_ethernet.rs b/examples/nrf/src/bin/usb_ethernet.rs index e57cdaf63..93cb05907 100644 --- a/examples/nrf/src/bin/usb_ethernet.rs +++ b/examples/nrf/src/bin/usb_ethernet.rs | |||
| @@ -8,10 +8,7 @@ use core::sync::atomic::{AtomicBool, Ordering}; | |||
| 8 | use core::task::Waker; | 8 | use core::task::Waker; |
| 9 | 9 | ||
| 10 | use defmt::*; | 10 | use defmt::*; |
| 11 | use embassy::blocking_mutex::raw::ThreadModeRawMutex; | 11 | use embassy_executor::executor::Spawner; |
| 12 | use embassy::channel::mpmc::Channel; | ||
| 13 | use embassy::executor::Spawner; | ||
| 14 | use embassy::util::Forever; | ||
| 15 | use embassy_net::tcp::TcpSocket; | 12 | use embassy_net::tcp::TcpSocket; |
| 16 | use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; | 13 | use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; |
| 17 | use embassy_nrf::rng::Rng; | 14 | use embassy_nrf::rng::Rng; |
| @@ -19,6 +16,9 @@ use embassy_nrf::usb::{Driver, PowerUsb}; | |||
| 19 | use embassy_nrf::{interrupt, pac, peripherals, Peripherals}; | 16 | use embassy_nrf::{interrupt, pac, peripherals, Peripherals}; |
| 20 | use embassy_usb::{Builder, Config, UsbDevice}; | 17 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 21 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; | 18 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; |
| 19 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 20 | use embassy_util::channel::mpmc::Channel; | ||
| 21 | use embassy_util::Forever; | ||
| 22 | use embedded_io::asynch::{Read, Write}; | 22 | use embedded_io::asynch::{Read, Write}; |
| 23 | use {defmt_rtt as _, panic_probe as _}; | 23 | use {defmt_rtt as _, panic_probe as _}; |
| 24 | 24 | ||
| @@ -32,12 +32,12 @@ macro_rules! forever { | |||
| 32 | }}; | 32 | }}; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | #[embassy::task] | 35 | #[embassy_executor::task] |
| 36 | async fn usb_task(mut device: UsbDevice<'static, MyDriver>) -> ! { | 36 | async fn usb_task(mut device: UsbDevice<'static, MyDriver>) -> ! { |
| 37 | device.run().await | 37 | device.run().await |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | #[embassy::task] | 40 | #[embassy_executor::task] |
| 41 | async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) { | 41 | async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) { |
| 42 | loop { | 42 | loop { |
| 43 | warn!("WAITING for connection"); | 43 | warn!("WAITING for connection"); |
| @@ -66,7 +66,7 @@ async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) { | |||
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | #[embassy::task] | 69 | #[embassy_executor::task] |
| 70 | async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) { | 70 | async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) { |
| 71 | loop { | 71 | loop { |
| 72 | let pkt = TX_CHANNEL.recv().await; | 72 | let pkt = TX_CHANNEL.recv().await; |
| @@ -76,12 +76,12 @@ async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) { | |||
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | #[embassy::task] | 79 | #[embassy_executor::task] |
| 80 | async fn net_task(stack: &'static Stack<Device>) -> ! { | 80 | async fn net_task(stack: &'static Stack<Device>) -> ! { |
| 81 | stack.run().await | 81 | stack.run().await |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | #[embassy::main] | 84 | #[embassy_executor::main] |
| 85 | async fn main(spawner: Spawner, p: Peripherals) { | 85 | async fn main(spawner: Spawner, p: Peripherals) { |
| 86 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; | 86 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; |
| 87 | 87 | ||
diff --git a/examples/nrf/src/bin/usb_hid_keyboard.rs b/examples/nrf/src/bin/usb_hid_keyboard.rs index 539ae6f16..863f3e5dd 100644 --- a/examples/nrf/src/bin/usb_hid_keyboard.rs +++ b/examples/nrf/src/bin/usb_hid_keyboard.rs | |||
| @@ -7,23 +7,22 @@ use core::mem; | |||
| 7 | use core::sync::atomic::{AtomicBool, Ordering}; | 7 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 8 | 8 | ||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy::channel::signal::Signal; | 10 | use embassy_executor::executor::Spawner; |
| 11 | use embassy::executor::Spawner; | ||
| 12 | use embassy::time::Duration; | ||
| 13 | use embassy::util::{select, Either}; | ||
| 14 | use embassy_nrf::gpio::{Input, Pin, Pull}; | 11 | use embassy_nrf::gpio::{Input, Pin, Pull}; |
| 15 | use embassy_nrf::usb::{Driver, PowerUsb}; | 12 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 16 | use embassy_nrf::{interrupt, pac, Peripherals}; | 13 | use embassy_nrf::{interrupt, pac, Peripherals}; |
| 17 | use embassy_usb::control::OutResponse; | 14 | use embassy_usb::control::OutResponse; |
| 18 | use embassy_usb::{Builder, Config, DeviceStateHandler}; | 15 | use embassy_usb::{Builder, Config, DeviceStateHandler}; |
| 19 | use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; | 16 | use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; |
| 17 | use embassy_util::channel::signal::Signal; | ||
| 18 | use embassy_util::{select, Either}; | ||
| 20 | use futures::future::join; | 19 | use futures::future::join; |
| 21 | use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; | 20 | use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; |
| 22 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 23 | 22 | ||
| 24 | static SUSPENDED: AtomicBool = AtomicBool::new(false); | 23 | static SUSPENDED: AtomicBool = AtomicBool::new(false); |
| 25 | 24 | ||
| 26 | #[embassy::main] | 25 | #[embassy_executor::main] |
| 27 | async fn main(_spawner: Spawner, p: Peripherals) { | 26 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 28 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; | 27 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; |
| 29 | 28 | ||
| @@ -154,11 +153,11 @@ impl RequestHandler for MyRequestHandler { | |||
| 154 | OutResponse::Accepted | 153 | OutResponse::Accepted |
| 155 | } | 154 | } |
| 156 | 155 | ||
| 157 | fn set_idle(&self, id: Option<ReportId>, dur: Duration) { | 156 | fn set_idle_ms(&self, id: Option<ReportId>, dur: u32) { |
| 158 | info!("Set idle rate for {:?} to {:?}", id, dur); | 157 | info!("Set idle rate for {:?} to {:?}", id, dur); |
| 159 | } | 158 | } |
| 160 | 159 | ||
| 161 | fn get_idle(&self, id: Option<ReportId>) -> Option<Duration> { | 160 | fn get_idle_ms(&self, id: Option<ReportId>) -> Option<u32> { |
| 162 | info!("Get idle rate for {:?}", id); | 161 | info!("Get idle rate for {:?}", id); |
| 163 | None | 162 | None |
| 164 | } | 163 | } |
diff --git a/examples/nrf/src/bin/usb_hid_mouse.rs b/examples/nrf/src/bin/usb_hid_mouse.rs index 516e7ea95..88bf87bd6 100644 --- a/examples/nrf/src/bin/usb_hid_mouse.rs +++ b/examples/nrf/src/bin/usb_hid_mouse.rs | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | use core::mem; | 6 | use core::mem; |
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy::executor::Spawner; | 9 | use embassy_executor::executor::Spawner; |
| 10 | use embassy::time::{Duration, Timer}; | 10 | use embassy_executor::time::{Duration, Timer}; |
| 11 | use embassy_nrf::usb::{Driver, PowerUsb}; | 11 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 12 | use embassy_nrf::{interrupt, pac, Peripherals}; | 12 | use embassy_nrf::{interrupt, pac, Peripherals}; |
| 13 | use embassy_usb::control::OutResponse; | 13 | use embassy_usb::control::OutResponse; |
| @@ -17,7 +17,7 @@ use futures::future::join; | |||
| 17 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; | 17 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | 19 | ||
| 20 | #[embassy::main] | 20 | #[embassy_executor::main] |
| 21 | async fn main(_spawner: Spawner, p: Peripherals) { | 21 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 22 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; | 22 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; |
| 23 | 23 | ||
| @@ -113,11 +113,11 @@ impl RequestHandler for MyRequestHandler { | |||
| 113 | OutResponse::Accepted | 113 | OutResponse::Accepted |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | fn set_idle(&self, id: Option<ReportId>, dur: Duration) { | 116 | fn set_idle_ms(&self, id: Option<ReportId>, dur: u32) { |
| 117 | info!("Set idle rate for {:?} to {:?}", id, dur); | 117 | info!("Set idle rate for {:?} to {:?}", id, dur); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | fn get_idle(&self, id: Option<ReportId>) -> Option<Duration> { | 120 | fn get_idle_ms(&self, id: Option<ReportId>) -> Option<u32> { |
| 121 | info!("Get idle rate for {:?}", id); | 121 | info!("Get idle rate for {:?}", id); |
| 122 | None | 122 | None |
| 123 | } | 123 | } |
diff --git a/examples/nrf/src/bin/usb_serial.rs b/examples/nrf/src/bin/usb_serial.rs index d2200dc5d..7d233d24d 100644 --- a/examples/nrf/src/bin/usb_serial.rs +++ b/examples/nrf/src/bin/usb_serial.rs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | use core::mem; | 6 | use core::mem; |
| 7 | 7 | ||
| 8 | use defmt::{info, panic}; | 8 | use defmt::{info, panic}; |
| 9 | use embassy::executor::Spawner; | 9 | use embassy_executor::executor::Spawner; |
| 10 | use embassy_nrf::usb::{Driver, Instance, PowerUsb, UsbSupply}; | 10 | use embassy_nrf::usb::{Driver, Instance, PowerUsb, UsbSupply}; |
| 11 | use embassy_nrf::{interrupt, pac, Peripherals}; | 11 | use embassy_nrf::{interrupt, pac, Peripherals}; |
| 12 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| @@ -15,7 +15,7 @@ use embassy_usb_serial::{CdcAcmClass, State}; | |||
| 15 | use futures::future::join; | 15 | use futures::future::join; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | #[embassy::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(_spawner: Spawner, p: Peripherals) { | 19 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 20 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; | 20 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; |
| 21 | 21 | ||
diff --git a/examples/nrf/src/bin/usb_serial_multitask.rs b/examples/nrf/src/bin/usb_serial_multitask.rs index 3806da5a0..956315322 100644 --- a/examples/nrf/src/bin/usb_serial_multitask.rs +++ b/examples/nrf/src/bin/usb_serial_multitask.rs | |||
| @@ -6,23 +6,23 @@ | |||
| 6 | use core::mem; | 6 | use core::mem; |
| 7 | 7 | ||
| 8 | use defmt::{info, panic, unwrap}; | 8 | use defmt::{info, panic, unwrap}; |
| 9 | use embassy::executor::Spawner; | 9 | use embassy_executor::executor::Spawner; |
| 10 | use embassy::util::Forever; | ||
| 11 | use embassy_nrf::usb::{Driver, PowerUsb}; | 10 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 12 | use embassy_nrf::{interrupt, pac, peripherals, Peripherals}; | 11 | use embassy_nrf::{interrupt, pac, peripherals, Peripherals}; |
| 13 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 14 | use embassy_usb::{Builder, Config, UsbDevice}; | 13 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 15 | use embassy_usb_serial::{CdcAcmClass, State}; | 14 | use embassy_usb_serial::{CdcAcmClass, State}; |
| 15 | use embassy_util::Forever; | ||
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | type MyDriver = Driver<'static, peripherals::USBD, PowerUsb>; | 18 | type MyDriver = Driver<'static, peripherals::USBD, PowerUsb>; |
| 19 | 19 | ||
| 20 | #[embassy::task] | 20 | #[embassy_executor::task] |
| 21 | async fn usb_task(mut device: UsbDevice<'static, MyDriver>) { | 21 | async fn usb_task(mut device: UsbDevice<'static, MyDriver>) { |
| 22 | device.run().await; | 22 | device.run().await; |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | #[embassy::task] | 25 | #[embassy_executor::task] |
| 26 | async fn echo_task(mut class: CdcAcmClass<'static, MyDriver>) { | 26 | async fn echo_task(mut class: CdcAcmClass<'static, MyDriver>) { |
| 27 | loop { | 27 | loop { |
| 28 | class.wait_connection().await; | 28 | class.wait_connection().await; |
| @@ -32,7 +32,7 @@ async fn echo_task(mut class: CdcAcmClass<'static, MyDriver>) { | |||
| 32 | } | 32 | } |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | #[embassy::main] | 35 | #[embassy_executor::main] |
| 36 | async fn main(spawner: Spawner, p: Peripherals) { | 36 | async fn main(spawner: Spawner, p: Peripherals) { |
| 37 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; | 37 | let clock: pac::CLOCK = unsafe { mem::transmute(()) }; |
| 38 | 38 | ||
diff --git a/examples/nrf/src/bin/wdt.rs b/examples/nrf/src/bin/wdt.rs index 280e23bcf..560cb3567 100644 --- a/examples/nrf/src/bin/wdt.rs +++ b/examples/nrf/src/bin/wdt.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_nrf::gpio::{Input, Pull}; | 7 | use embassy_nrf::gpio::{Input, Pull}; |
| 8 | use embassy_nrf::wdt::{Config, Watchdog}; | 8 | use embassy_nrf::wdt::{Config, Watchdog}; |
| 9 | use embassy_nrf::Peripherals; | 9 | use embassy_nrf::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index d0704f203..94c3d8013 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -5,7 +5,8 @@ version = "0.1.0" | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] } | 8 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime"] } | ||
| 9 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } | 10 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } |
| 10 | atomic-polyfill = "0.1.5" | 11 | atomic-polyfill = "0.1.5" |
| 11 | 12 | ||
diff --git a/examples/rp/src/bin/blinky.rs b/examples/rp/src/bin/blinky.rs index 35612a4cf..e53fca1af 100644 --- a/examples/rp/src/bin/blinky.rs +++ b/examples/rp/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_rp::{gpio, Peripherals}; | 8 | use embassy_rp::{gpio, Peripherals}; |
| 9 | use gpio::{Level, Output}; | 9 | use gpio::{Level, Output}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | let mut led = Output::new(p.PIN_25, Level::Low); | 14 | let mut led = Output::new(p.PIN_25, Level::Low); |
| 15 | 15 | ||
diff --git a/examples/rp/src/bin/button.rs b/examples/rp/src/bin/button.rs index 980e54ea1..02cbc9416 100644 --- a/examples/rp/src/bin/button.rs +++ b/examples/rp/src/bin/button.rs | |||
| @@ -2,12 +2,12 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use embassy::executor::Spawner; | 5 | use embassy_executor::executor::Spawner; |
| 6 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 6 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
| 7 | use embassy_rp::Peripherals; | 7 | use embassy_rp::Peripherals; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 9 | ||
| 10 | #[embassy::main] | 10 | #[embassy_executor::main] |
| 11 | async fn main(_spawner: Spawner, p: Peripherals) { | 11 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 12 | let button = Input::new(p.PIN_28, Pull::Up); | 12 | let button = Input::new(p.PIN_28, Pull::Up); |
| 13 | let mut led = Output::new(p.PIN_25, Level::Low); | 13 | let mut led = Output::new(p.PIN_25, Level::Low); |
diff --git a/examples/rp/src/bin/gpio_async.rs b/examples/rp/src/bin/gpio_async.rs index e0f2aa961..ba905b015 100644 --- a/examples/rp/src/bin/gpio_async.rs +++ b/examples/rp/src/bin/gpio_async.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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_rp::{gpio, Peripherals}; | 8 | use embassy_rp::{gpio, Peripherals}; |
| 9 | use gpio::{Input, Level, Output, Pull}; | 9 | use gpio::{Input, Level, Output, Pull}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -19,7 +19,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 19 | /// high signal on PIN 16. Once the high event/signal occurs the program will | 19 | /// high signal on PIN 16. Once the high event/signal occurs the program will |
| 20 | /// continue and turn off the LED, and then wait for 2 seconds before completing | 20 | /// continue and turn off the LED, and then wait for 2 seconds before completing |
| 21 | /// the loop and starting over again. | 21 | /// the loop and starting over again. |
| 22 | #[embassy::main] | 22 | #[embassy_executor::main] |
| 23 | async fn main(_spawner: Spawner, p: Peripherals) { | 23 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 24 | let mut led = Output::new(p.PIN_25, Level::Low); | 24 | let mut led = Output::new(p.PIN_25, Level::Low); |
| 25 | let mut async_input = Input::new(p.PIN_16, Pull::None); | 25 | let mut async_input = Input::new(p.PIN_16, Pull::None); |
diff --git a/examples/rp/src/bin/spi.rs b/examples/rp/src/bin/spi.rs index d97aa94b3..a3160c106 100644 --- a/examples/rp/src/bin/spi.rs +++ b/examples/rp/src/bin/spi.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_rp::spi::Spi; | 7 | use embassy_rp::spi::Spi; |
| 8 | use embassy_rp::{gpio, spi, Peripherals}; | 8 | use embassy_rp::{gpio, spi, Peripherals}; |
| 9 | use gpio::{Level, Output}; | 9 | use gpio::{Level, Output}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/rp/src/bin/spi_display.rs b/examples/rp/src/bin/spi_display.rs index f4a411ba6..2760b23fa 100644 --- a/examples/rp/src/bin/spi_display.rs +++ b/examples/rp/src/bin/spi_display.rs | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | use core::cell::RefCell; | 5 | use core::cell::RefCell; |
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy::time::Delay; | 9 | use embassy_executor::time::Delay; |
| 10 | use embassy_rp::gpio::{Level, Output}; | 10 | use embassy_rp::gpio::{Level, Output}; |
| 11 | use embassy_rp::spi::Spi; | 11 | use embassy_rp::spi::Spi; |
| 12 | use embassy_rp::{spi, Peripherals}; | 12 | use embassy_rp::{spi, Peripherals}; |
| @@ -27,7 +27,7 @@ use crate::touch::Touch; | |||
| 27 | //const DISPLAY_FREQ: u32 = 64_000_000; | 27 | //const DISPLAY_FREQ: u32 = 64_000_000; |
| 28 | const TOUCH_FREQ: u32 = 200_000; | 28 | const TOUCH_FREQ: u32 = 200_000; |
| 29 | 29 | ||
| 30 | #[embassy::main] | 30 | #[embassy_executor::main] |
| 31 | async fn main(_spawner: Spawner, p: Peripherals) { | 31 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 32 | info!("Hello World!"); | 32 | info!("Hello World!"); |
| 33 | 33 | ||
diff --git a/examples/rp/src/bin/uart.rs b/examples/rp/src/bin/uart.rs index 99072253a..0d2954894 100644 --- a/examples/rp/src/bin/uart.rs +++ b/examples/rp/src/bin/uart.rs | |||
| @@ -2,11 +2,11 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use embassy::executor::Spawner; | 5 | use embassy_executor::executor::Spawner; |
| 6 | use embassy_rp::{uart, Peripherals}; | 6 | use embassy_rp::{uart, Peripherals}; |
| 7 | use {defmt_rtt as _, panic_probe as _}; | 7 | use {defmt_rtt as _, panic_probe as _}; |
| 8 | 8 | ||
| 9 | #[embassy::main] | 9 | #[embassy_executor::main] |
| 10 | async fn main(_spawner: Spawner, p: Peripherals) { | 10 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 11 | let config = uart::Config::default(); | 11 | let config = uart::Config::default(); |
| 12 | let mut uart = uart::Uart::new(p.UART0, p.PIN_0, p.PIN_1, p.PIN_2, p.PIN_3, config); | 12 | let mut uart = uart::Uart::new(p.UART0, p.PIN_0, p.PIN_1, p.PIN_2, p.PIN_3, config); |
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index 8787f3c92..54499796b 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-std-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "std", "time", "nightly"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["log"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "std", "time", "nightly"] } | ||
| 8 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "tcp", "dhcpv4", "pool-16"] } | 9 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "tcp", "dhcpv4", "pool-16"] } |
| 9 | embedded-io = { version = "0.3.0", features = ["async", "std", "futures"] } | 10 | embedded-io = { version = "0.3.0", features = ["async", "std", "futures"] } |
| 10 | 11 | ||
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs index 74073ee81..202585289 100644 --- a/examples/std/src/bin/net.rs +++ b/examples/std/src/bin/net.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | 1 | #![feature(type_alias_impl_trait)] |
| 2 | 2 | ||
| 3 | use clap::Parser; | 3 | use clap::Parser; |
| 4 | use embassy::executor::{Executor, Spawner}; | 4 | use embassy_executor::executor::{Executor, Spawner}; |
| 5 | use embassy::util::Forever; | ||
| 6 | use embassy_net::tcp::TcpSocket; | 5 | use embassy_net::tcp::TcpSocket; |
| 7 | use embassy_net::{ConfigStrategy, Ipv4Address, Ipv4Cidr, Stack, StackResources}; | 6 | use embassy_net::{ConfigStrategy, Ipv4Address, Ipv4Cidr, Stack, StackResources}; |
| 7 | use embassy_util::Forever; | ||
| 8 | use embedded_io::asynch::Write; | 8 | use embedded_io::asynch::Write; |
| 9 | use heapless::Vec; | 9 | use heapless::Vec; |
| 10 | use log::*; | 10 | use log::*; |
| @@ -34,12 +34,12 @@ struct Opts { | |||
| 34 | static_ip: bool, | 34 | static_ip: bool, |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | #[embassy::task] | 37 | #[embassy_executor::task] |
| 38 | async fn net_task(stack: &'static Stack<TunTapDevice>) -> ! { | 38 | async fn net_task(stack: &'static Stack<TunTapDevice>) -> ! { |
| 39 | stack.run().await | 39 | stack.run().await |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | #[embassy::task] | 42 | #[embassy_executor::task] |
| 43 | async fn main_task(spawner: Spawner) { | 43 | async fn main_task(spawner: Spawner) { |
| 44 | let opts: Opts = Opts::parse(); | 44 | let opts: Opts = Opts::parse(); |
| 45 | 45 | ||
diff --git a/examples/std/src/bin/serial.rs b/examples/std/src/bin/serial.rs index b1e5b0142..b803d1ef7 100644 --- a/examples/std/src/bin/serial.rs +++ b/examples/std/src/bin/serial.rs | |||
| @@ -4,15 +4,15 @@ | |||
| 4 | mod serial_port; | 4 | mod serial_port; |
| 5 | 5 | ||
| 6 | use async_io::Async; | 6 | use async_io::Async; |
| 7 | use embassy::executor::Executor; | 7 | use embassy_executor::executor::Executor; |
| 8 | use embassy::util::Forever; | 8 | use embassy_util::Forever; |
| 9 | use embedded_io::asynch::Read; | 9 | use embedded_io::asynch::Read; |
| 10 | use log::*; | 10 | use log::*; |
| 11 | use nix::sys::termios; | 11 | use nix::sys::termios; |
| 12 | 12 | ||
| 13 | use self::serial_port::SerialPort; | 13 | use self::serial_port::SerialPort; |
| 14 | 14 | ||
| 15 | #[embassy::task] | 15 | #[embassy_executor::task] |
| 16 | async fn run() { | 16 | async fn run() { |
| 17 | // Open the serial port. | 17 | // Open the serial port. |
| 18 | let baudrate = termios::BaudRate::B115200; | 18 | let baudrate = termios::BaudRate::B115200; |
diff --git a/examples/std/src/bin/tick.rs b/examples/std/src/bin/tick.rs index bed9d7dc5..9ca900df8 100644 --- a/examples/std/src/bin/tick.rs +++ b/examples/std/src/bin/tick.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | 1 | #![feature(type_alias_impl_trait)] |
| 2 | 2 | ||
| 3 | use embassy::executor::Spawner; | 3 | use embassy_executor::executor::Spawner; |
| 4 | use embassy::time::{Duration, Timer}; | 4 | use embassy_executor::time::{Duration, Timer}; |
| 5 | use log::*; | 5 | use log::*; |
| 6 | 6 | ||
| 7 | #[embassy::task] | 7 | #[embassy_executor::task] |
| 8 | async fn run() { | 8 | async fn run() { |
| 9 | loop { | 9 | loop { |
| 10 | info!("tick"); | 10 | info!("tick"); |
| @@ -12,7 +12,7 @@ async fn run() { | |||
| 12 | } | 12 | } |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | #[embassy::main] | 15 | #[embassy_executor::main] |
| 16 | async fn main(spawner: Spawner) { | 16 | async fn main(spawner: Spawner) { |
| 17 | env_logger::builder() | 17 | env_logger::builder() |
| 18 | .filter_level(log::LevelFilter::Debug) | 18 | .filter_level(log::LevelFilter::Debug) |
diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml index 615803258..3ba297636 100644 --- a/examples/stm32f0/Cargo.toml +++ b/examples/stm32f0/Cargo.toml | |||
| @@ -11,6 +11,7 @@ cortex-m-rt = "0.7.0" | |||
| 11 | defmt = "0.3" | 11 | defmt = "0.3" |
| 12 | defmt-rtt = "0.3" | 12 | defmt-rtt = "0.3" |
| 13 | panic-probe = "0.3" | 13 | panic-probe = "0.3" |
| 14 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 14 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 15 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 15 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f030f4", "time-driver-any"] } | 16 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f030f4", "time-driver-any"] } |
| 16 | 17 | ||
diff --git a/examples/stm32f0/src/bin/hello.rs b/examples/stm32f0/src/bin/hello.rs index 225f1c3ae..c9081ea12 100644 --- a/examples/stm32f0/src/bin/hello.rs +++ b/examples/stm32f0/src/bin/hello.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 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_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { | 12 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { |
| 13 | loop { | 13 | loop { |
| 14 | Timer::after(Duration::from_secs(1)).await; | 14 | Timer::after(Duration::from_secs(1)).await; |
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml index fb0e605d6..9ce553b6d 100644 --- a/examples/stm32f1/Cargo.toml +++ b/examples/stm32f1/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32f1-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] } |
| 9 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 10 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 10 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } | 11 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } |
diff --git a/examples/stm32f1/src/bin/adc.rs b/examples/stm32f1/src/bin/adc.rs index 09904d4cc..e54593fe5 100644 --- a/examples/stm32f1/src/bin/adc.rs +++ b/examples/stm32f1/src/bin/adc.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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::{Delay, Duration, Timer}; | 7 | use embassy_executor::time::{Delay, Duration, Timer}; |
| 8 | use embassy_stm32::adc::Adc; | 8 | use embassy_stm32::adc::Adc; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f1/src/bin/blinky.rs b/examples/stm32f1/src/bin/blinky.rs index c98d0cdad..5171043e8 100644 --- a/examples/stm32f1/src/bin/blinky.rs +++ b/examples/stm32f1/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f1/src/bin/hello.rs b/examples/stm32f1/src/bin/hello.rs index 82f11bc28..549d1bfba 100644 --- a/examples/stm32f1/src/bin/hello.rs +++ b/examples/stm32f1/src/bin/hello.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 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_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::{Config, Peripherals}; | 9 | use embassy_stm32::{Config, Peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -15,7 +15,7 @@ fn config() -> Config { | |||
| 15 | config | 15 | config |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main(config = "config()")] | 18 | #[embassy_executor::main(config = "config()")] |
| 19 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { | 19 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { |
| 20 | loop { | 20 | loop { |
| 21 | info!("Hello World!"); | 21 | info!("Hello World!"); |
diff --git a/examples/stm32f1/src/bin/usb_serial.rs b/examples/stm32f1/src/bin/usb_serial.rs index d06315d76..cf7facb79 100644 --- a/examples/stm32f1/src/bin/usb_serial.rs +++ b/examples/stm32f1/src/bin/usb_serial.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{panic, *}; | 5 | use defmt::{panic, *}; |
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::time::Hertz; | 9 | use embassy_stm32::time::Hertz; |
| 10 | use embassy_stm32::usb::{Driver, Instance}; | 10 | use embassy_stm32::usb::{Driver, Instance}; |
| @@ -23,7 +23,7 @@ fn config() -> Config { | |||
| 23 | config | 23 | config |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | #[embassy::main(config = "config()")] | 26 | #[embassy_executor::main(config = "config()")] |
| 27 | async fn main(_spawner: Spawner, mut p: Peripherals) { | 27 | async fn main(_spawner: Spawner, mut p: Peripherals) { |
| 28 | info!("Hello World!"); | 28 | info!("Hello World!"); |
| 29 | 29 | ||
diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml index 6ea6add17..a3fb736da 100644 --- a/examples/stm32f2/Cargo.toml +++ b/examples/stm32f2/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32f2-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 9 | 10 | ||
| 10 | defmt = "0.3" | 11 | defmt = "0.3" |
diff --git a/examples/stm32f2/src/bin/blinky.rs b/examples/stm32f2/src/bin/blinky.rs index dd20ba85a..48ae2e711 100644 --- a/examples/stm32f2/src/bin/blinky.rs +++ b/examples/stm32f2/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f2/src/bin/pll.rs b/examples/stm32f2/src/bin/pll.rs index b09d64b0b..01e63b15e 100644 --- a/examples/stm32f2/src/bin/pll.rs +++ b/examples/stm32f2/src/bin/pll.rs | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | use core::convert::TryFrom; | 5 | use core::convert::TryFrom; |
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy::time::{Duration, Timer}; | 9 | use embassy_executor::time::{Duration, Timer}; |
| 10 | use embassy_stm32::rcc::{ | 10 | use embassy_stm32::rcc::{ |
| 11 | APBPrescaler, ClockSrc, HSEConfig, HSESrc, PLL48Div, PLLConfig, PLLMainDiv, PLLMul, PLLPreDiv, PLLSrc, | 11 | APBPrescaler, ClockSrc, HSEConfig, HSESrc, PLL48Div, PLLConfig, PLLMainDiv, PLLMul, PLLPreDiv, PLLSrc, |
| 12 | }; | 12 | }; |
| @@ -43,7 +43,7 @@ fn config() -> Config { | |||
| 43 | config | 43 | config |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | #[embassy::main(config = "config()")] | 46 | #[embassy_executor::main(config = "config()")] |
| 47 | async fn main(_spawner: Spawner, _p: Peripherals) { | 47 | async fn main(_spawner: Spawner, _p: Peripherals) { |
| 48 | loop { | 48 | loop { |
| 49 | Timer::after(Duration::from_millis(1000)).await; | 49 | Timer::after(Duration::from_millis(1000)).await; |
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml index 6912ba765..410e9b3e0 100644 --- a/examples/stm32f3/Cargo.toml +++ b/examples/stm32f3/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32f3-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 9 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 10 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 10 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } | 11 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } |
diff --git a/examples/stm32f3/src/bin/blinky.rs b/examples/stm32f3/src/bin/blinky.rs index 4d0b33f61..7146eaa54 100644 --- a/examples/stm32f3/src/bin/blinky.rs +++ b/examples/stm32f3/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs index 45862ddc6..ef5110316 100644 --- a/examples/stm32f3/src/bin/button_events.rs +++ b/examples/stm32f3/src/bin/button_events.rs | |||
| @@ -11,14 +11,14 @@ | |||
| 11 | #![feature(type_alias_impl_trait)] | 11 | #![feature(type_alias_impl_trait)] |
| 12 | 12 | ||
| 13 | use defmt::*; | 13 | use defmt::*; |
| 14 | use embassy::blocking_mutex::raw::ThreadModeRawMutex; | 14 | use embassy_executor::executor::Spawner; |
| 15 | use embassy::channel::mpmc::Channel; | 15 | use embassy_executor::time::{with_timeout, Duration, Timer}; |
| 16 | use embassy::executor::Spawner; | ||
| 17 | use embassy::time::{with_timeout, Duration, Timer}; | ||
| 18 | use embassy_stm32::exti::ExtiInput; | 16 | use embassy_stm32::exti::ExtiInput; |
| 19 | use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; | 17 | use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; |
| 20 | use embassy_stm32::peripherals::PA0; | 18 | use embassy_stm32::peripherals::PA0; |
| 21 | use embassy_stm32::Peripherals; | 19 | use embassy_stm32::Peripherals; |
| 20 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 21 | use embassy_util::channel::mpmc::Channel; | ||
| 22 | use {defmt_rtt as _, panic_probe as _}; | 22 | use {defmt_rtt as _, panic_probe as _}; |
| 23 | 23 | ||
| 24 | struct Leds<'a> { | 24 | struct Leds<'a> { |
| @@ -99,7 +99,7 @@ enum ButtonEvent { | |||
| 99 | 99 | ||
| 100 | static CHANNEL: Channel<ThreadModeRawMutex, ButtonEvent, 4> = Channel::new(); | 100 | static CHANNEL: Channel<ThreadModeRawMutex, ButtonEvent, 4> = Channel::new(); |
| 101 | 101 | ||
| 102 | #[embassy::main] | 102 | #[embassy_executor::main] |
| 103 | async fn main(spawner: Spawner, p: Peripherals) { | 103 | async fn main(spawner: Spawner, p: Peripherals) { |
| 104 | let button = Input::new(p.PA0, Pull::Down); | 104 | let button = Input::new(p.PA0, Pull::Down); |
| 105 | let button = ExtiInput::new(button, p.EXTI0); | 105 | let button = ExtiInput::new(button, p.EXTI0); |
| @@ -120,14 +120,14 @@ async fn main(spawner: Spawner, p: Peripherals) { | |||
| 120 | spawner.spawn(led_blinker(leds)).unwrap(); | 120 | spawner.spawn(led_blinker(leds)).unwrap(); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | #[embassy::task] | 123 | #[embassy_executor::task] |
| 124 | async fn led_blinker(mut leds: Leds<'static>) { | 124 | async fn led_blinker(mut leds: Leds<'static>) { |
| 125 | loop { | 125 | loop { |
| 126 | leds.show().await; | 126 | leds.show().await; |
| 127 | } | 127 | } |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | #[embassy::task] | 130 | #[embassy_executor::task] |
| 131 | async fn button_waiter(mut button: ExtiInput<'static, PA0>) { | 131 | async fn button_waiter(mut button: ExtiInput<'static, PA0>) { |
| 132 | const DOUBLE_CLICK_DELAY: u64 = 250; | 132 | const DOUBLE_CLICK_DELAY: u64 = 250; |
| 133 | const HOLD_DELAY: u64 = 1000; | 133 | const HOLD_DELAY: u64 = 1000; |
diff --git a/examples/stm32f3/src/bin/button_exti.rs b/examples/stm32f3/src/bin/button_exti.rs index add6712b4..dee06e5de 100644 --- a/examples/stm32f3/src/bin/button_exti.rs +++ b/examples/stm32f3/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f3/src/bin/flash.rs b/examples/stm32f3/src/bin/flash.rs index ce16f6de7..be2f6f671 100644 --- a/examples/stm32f3/src/bin/flash.rs +++ b/examples/stm32f3/src/bin/flash.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_stm32::flash::Flash; | 7 | use embassy_stm32::flash::Flash; |
| 8 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello Flash!"); | 14 | info!("Hello Flash!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f3/src/bin/hello.rs b/examples/stm32f3/src/bin/hello.rs index 3b89f1c72..bd9953a0e 100644 --- a/examples/stm32f3/src/bin/hello.rs +++ b/examples/stm32f3/src/bin/hello.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 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_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::{Config, Peripherals}; | 9 | use embassy_stm32::{Config, Peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -16,7 +16,7 @@ fn config() -> Config { | |||
| 16 | config | 16 | config |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | #[embassy::main(config = "config()")] | 19 | #[embassy_executor::main(config = "config()")] |
| 20 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { | 20 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { |
| 21 | loop { | 21 | loop { |
| 22 | info!("Hello World!"); | 22 | info!("Hello World!"); |
diff --git a/examples/stm32f3/src/bin/multiprio.rs b/examples/stm32f3/src/bin/multiprio.rs index 4f2cf9a6f..fba5b286e 100644 --- a/examples/stm32f3/src/bin/multiprio.rs +++ b/examples/stm32f3/src/bin/multiprio.rs | |||
| @@ -59,14 +59,14 @@ | |||
| 59 | 59 | ||
| 60 | use cortex_m_rt::entry; | 60 | use cortex_m_rt::entry; |
| 61 | use defmt::*; | 61 | use defmt::*; |
| 62 | use embassy::time::{Duration, Instant, Timer}; | 62 | use embassy_executor::time::{Duration, Instant, Timer}; |
| 63 | use embassy::util::Forever; | ||
| 64 | use embassy_stm32::executor::{Executor, InterruptExecutor}; | 63 | use embassy_stm32::executor::{Executor, InterruptExecutor}; |
| 65 | use embassy_stm32::interrupt; | 64 | use embassy_stm32::interrupt; |
| 66 | use embassy_stm32::interrupt::InterruptExt; | 65 | use embassy_stm32::interrupt::InterruptExt; |
| 66 | use embassy_util::Forever; | ||
| 67 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| 68 | 68 | ||
| 69 | #[embassy::task] | 69 | #[embassy_executor::task] |
| 70 | async fn run_high() { | 70 | async fn run_high() { |
| 71 | loop { | 71 | loop { |
| 72 | info!(" [high] tick!"); | 72 | info!(" [high] tick!"); |
| @@ -74,7 +74,7 @@ async fn run_high() { | |||
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | #[embassy::task] | 77 | #[embassy_executor::task] |
| 78 | async fn run_med() { | 78 | async fn run_med() { |
| 79 | loop { | 79 | loop { |
| 80 | let start = Instant::now(); | 80 | let start = Instant::now(); |
| @@ -91,7 +91,7 @@ async fn run_med() { | |||
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | #[embassy::task] | 94 | #[embassy_executor::task] |
| 95 | async fn run_low() { | 95 | async fn run_low() { |
| 96 | loop { | 96 | loop { |
| 97 | let start = Instant::now(); | 97 | let start = Instant::now(); |
diff --git a/examples/stm32f3/src/bin/spi_dma.rs b/examples/stm32f3/src/bin/spi_dma.rs index ece1ae6fe..f554c509a 100644 --- a/examples/stm32f3/src/bin/spi_dma.rs +++ b/examples/stm32f3/src/bin/spi_dma.rs | |||
| @@ -6,14 +6,14 @@ use core::fmt::Write; | |||
| 6 | use core::str::from_utf8; | 6 | use core::str::from_utf8; |
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy::executor::Spawner; | 9 | use embassy_executor::executor::Spawner; |
| 10 | use embassy_stm32::spi::{Config, Spi}; | 10 | use embassy_stm32::spi::{Config, Spi}; |
| 11 | use embassy_stm32::time::Hertz; | 11 | use embassy_stm32::time::Hertz; |
| 12 | use embassy_stm32::Peripherals; | 12 | use embassy_stm32::Peripherals; |
| 13 | use heapless::String; | 13 | use heapless::String; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy_executor::main] |
| 17 | async fn main(_spawner: Spawner, p: Peripherals) { | 17 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 18 | info!("Hello World!"); | 18 | info!("Hello World!"); |
| 19 | 19 | ||
diff --git a/examples/stm32f3/src/bin/usart_dma.rs b/examples/stm32f3/src/bin/usart_dma.rs index 4660f812e..62d165029 100644 --- a/examples/stm32f3/src/bin/usart_dma.rs +++ b/examples/stm32f3/src/bin/usart_dma.rs | |||
| @@ -5,14 +5,14 @@ | |||
| 5 | use core::fmt::Write; | 5 | use core::fmt::Write; |
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy_stm32::dma::NoDma; | 9 | use embassy_stm32::dma::NoDma; |
| 10 | use embassy_stm32::usart::{Config, Uart}; | 10 | use embassy_stm32::usart::{Config, Uart}; |
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use heapless::String; | 12 | use heapless::String; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | #[embassy::main] | 15 | #[embassy_executor::main] |
| 16 | async fn main(_spawner: Spawner, p: Peripherals) { | 16 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 17 | info!("Hello World!"); | 17 | info!("Hello World!"); |
| 18 | 18 | ||
diff --git a/examples/stm32f3/src/bin/usb_serial.rs b/examples/stm32f3/src/bin/usb_serial.rs index 463d561ec..87b1138f5 100644 --- a/examples/stm32f3/src/bin/usb_serial.rs +++ b/examples/stm32f3/src/bin/usb_serial.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{panic, *}; | 5 | use defmt::{panic, *}; |
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::time::mhz; | 9 | use embassy_stm32::time::mhz; |
| 10 | use embassy_stm32::usb::{Driver, Instance}; | 10 | use embassy_stm32::usb::{Driver, Instance}; |
| @@ -27,7 +27,7 @@ fn config() -> Config { | |||
| 27 | config | 27 | config |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | #[embassy::main(config = "config()")] | 30 | #[embassy_executor::main(config = "config()")] |
| 31 | async fn main(_spawner: Spawner, p: Peripherals) { | 31 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 32 | info!("Hello World!"); | 32 | info!("Hello World!"); |
| 33 | 33 | ||
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml index 100c0e608..37464b1e0 100644 --- a/examples/stm32f4/Cargo.toml +++ b/examples/stm32f4/Cargo.toml | |||
| @@ -5,7 +5,8 @@ version = "0.1.0" | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "time-tick-32768hz"] } | 8 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "time-tick-32768hz"] } | ||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 10 | 11 | ||
| 11 | defmt = "0.3" | 12 | defmt = "0.3" |
diff --git a/examples/stm32f4/src/bin/adc.rs b/examples/stm32f4/src/bin/adc.rs index 84ddbfd3c..27ed4fcc5 100644 --- a/examples/stm32f4/src/bin/adc.rs +++ b/examples/stm32f4/src/bin/adc.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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::{Delay, Duration, Timer}; | 7 | use embassy_executor::time::{Delay, Duration, Timer}; |
| 8 | use embassy_stm32::adc::Adc; | 8 | use embassy_stm32::adc::Adc; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f4/src/bin/blinky.rs b/examples/stm32f4/src/bin/blinky.rs index 907492b3d..f71fe0989 100644 --- a/examples/stm32f4/src/bin/blinky.rs +++ b/examples/stm32f4/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f4/src/bin/button_exti.rs b/examples/stm32f4/src/bin/button_exti.rs index 24ece9927..60dfb362b 100644 --- a/examples/stm32f4/src/bin/button_exti.rs +++ b/examples/stm32f4/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f4/src/bin/flash.rs b/examples/stm32f4/src/bin/flash.rs index 13fd2c90b..4f780656e 100644 --- a/examples/stm32f4/src/bin/flash.rs +++ b/examples/stm32f4/src/bin/flash.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_stm32::flash::Flash; | 7 | use embassy_stm32::flash::Flash; |
| 8 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello Flash!"); | 14 | info!("Hello Flash!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f4/src/bin/hello.rs b/examples/stm32f4/src/bin/hello.rs index 8e69e89d1..f957656ef 100644 --- a/examples/stm32f4/src/bin/hello.rs +++ b/examples/stm32f4/src/bin/hello.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 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_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::{Config, Peripherals}; | 9 | use embassy_stm32::{Config, Peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -15,7 +15,7 @@ fn config() -> Config { | |||
| 15 | config | 15 | config |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main(config = "config()")] | 18 | #[embassy_executor::main(config = "config()")] |
| 19 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { | 19 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { |
| 20 | loop { | 20 | loop { |
| 21 | info!("Hello World!"); | 21 | info!("Hello World!"); |
diff --git a/examples/stm32f4/src/bin/multiprio.rs b/examples/stm32f4/src/bin/multiprio.rs index 4f2cf9a6f..fba5b286e 100644 --- a/examples/stm32f4/src/bin/multiprio.rs +++ b/examples/stm32f4/src/bin/multiprio.rs | |||
| @@ -59,14 +59,14 @@ | |||
| 59 | 59 | ||
| 60 | use cortex_m_rt::entry; | 60 | use cortex_m_rt::entry; |
| 61 | use defmt::*; | 61 | use defmt::*; |
| 62 | use embassy::time::{Duration, Instant, Timer}; | 62 | use embassy_executor::time::{Duration, Instant, Timer}; |
| 63 | use embassy::util::Forever; | ||
| 64 | use embassy_stm32::executor::{Executor, InterruptExecutor}; | 63 | use embassy_stm32::executor::{Executor, InterruptExecutor}; |
| 65 | use embassy_stm32::interrupt; | 64 | use embassy_stm32::interrupt; |
| 66 | use embassy_stm32::interrupt::InterruptExt; | 65 | use embassy_stm32::interrupt::InterruptExt; |
| 66 | use embassy_util::Forever; | ||
| 67 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| 68 | 68 | ||
| 69 | #[embassy::task] | 69 | #[embassy_executor::task] |
| 70 | async fn run_high() { | 70 | async fn run_high() { |
| 71 | loop { | 71 | loop { |
| 72 | info!(" [high] tick!"); | 72 | info!(" [high] tick!"); |
| @@ -74,7 +74,7 @@ async fn run_high() { | |||
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | #[embassy::task] | 77 | #[embassy_executor::task] |
| 78 | async fn run_med() { | 78 | async fn run_med() { |
| 79 | loop { | 79 | loop { |
| 80 | let start = Instant::now(); | 80 | let start = Instant::now(); |
| @@ -91,7 +91,7 @@ async fn run_med() { | |||
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | #[embassy::task] | 94 | #[embassy_executor::task] |
| 95 | async fn run_low() { | 95 | async fn run_low() { |
| 96 | loop { | 96 | loop { |
| 97 | let start = Instant::now(); | 97 | let start = Instant::now(); |
diff --git a/examples/stm32f4/src/bin/pwm.rs b/examples/stm32f4/src/bin/pwm.rs index b39bbbe28..0b352c2b7 100644 --- a/examples/stm32f4/src/bin/pwm.rs +++ b/examples/stm32f4/src/bin/pwm.rs | |||
| @@ -3,15 +3,15 @@ | |||
| 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_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; | 8 | use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; |
| 9 | use embassy_stm32::pwm::Channel; | 9 | use embassy_stm32::pwm::Channel; |
| 10 | use embassy_stm32::time::khz; | 10 | use embassy_stm32::time::khz; |
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | #[embassy::main] | 14 | #[embassy_executor::main] |
| 15 | async fn main(_spawner: Spawner, p: Peripherals) { | 15 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 16 | info!("Hello World!"); | 16 | info!("Hello World!"); |
| 17 | 17 | ||
diff --git a/examples/stm32f4/src/bin/sdmmc.rs b/examples/stm32f4/src/bin/sdmmc.rs index 752ad57bf..6eef19963 100644 --- a/examples/stm32f4/src/bin/sdmmc.rs +++ b/examples/stm32f4/src/bin/sdmmc.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::sdmmc::Sdmmc; | 7 | use embassy_stm32::sdmmc::Sdmmc; |
| 8 | use embassy_stm32::time::mhz; | 8 | use embassy_stm32::time::mhz; |
| 9 | use embassy_stm32::{interrupt, Config, Peripherals}; | 9 | use embassy_stm32::{interrupt, Config, Peripherals}; |
| @@ -15,7 +15,7 @@ fn config() -> Config { | |||
| 15 | config | 15 | config |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main(config = "config()")] | 18 | #[embassy_executor::main(config = "config()")] |
| 19 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { | 19 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { |
| 20 | info!("Hello World!"); | 20 | info!("Hello World!"); |
| 21 | 21 | ||
diff --git a/examples/stm32f4/src/bin/spi_dma.rs b/examples/stm32f4/src/bin/spi_dma.rs index f3c0f2cd5..023ca0971 100644 --- a/examples/stm32f4/src/bin/spi_dma.rs +++ b/examples/stm32f4/src/bin/spi_dma.rs | |||
| @@ -6,14 +6,14 @@ use core::fmt::Write; | |||
| 6 | use core::str::from_utf8; | 6 | use core::str::from_utf8; |
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy::executor::Spawner; | 9 | use embassy_executor::executor::Spawner; |
| 10 | use embassy_stm32::spi::{Config, Spi}; | 10 | use embassy_stm32::spi::{Config, Spi}; |
| 11 | use embassy_stm32::time::Hertz; | 11 | use embassy_stm32::time::Hertz; |
| 12 | use embassy_stm32::Peripherals; | 12 | use embassy_stm32::Peripherals; |
| 13 | use heapless::String; | 13 | use heapless::String; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy_executor::main] |
| 17 | async fn main(_spawner: Spawner, p: Peripherals) { | 17 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 18 | info!("Hello World!"); | 18 | info!("Hello World!"); |
| 19 | 19 | ||
diff --git a/examples/stm32f4/src/bin/usart_buffered.rs b/examples/stm32f4/src/bin/usart_buffered.rs index 039e43bd2..2555998ce 100644 --- a/examples/stm32f4/src/bin/usart_buffered.rs +++ b/examples/stm32f4/src/bin/usart_buffered.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_stm32::dma::NoDma; | 7 | use embassy_stm32::dma::NoDma; |
| 8 | use embassy_stm32::usart::{BufferedUart, Config, State, Uart}; | 8 | use embassy_stm32::usart::{BufferedUart, Config, State, Uart}; |
| 9 | use embassy_stm32::{interrupt, Peripherals}; | 9 | use embassy_stm32::{interrupt, Peripherals}; |
| 10 | use embedded_io::asynch::BufRead; | 10 | use embedded_io::asynch::BufRead; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | info!("Hello World!"); | 15 | info!("Hello World!"); |
| 16 | 16 | ||
diff --git a/examples/stm32f4/src/bin/usart_dma.rs b/examples/stm32f4/src/bin/usart_dma.rs index 8d06f8439..7859ba2ae 100644 --- a/examples/stm32f4/src/bin/usart_dma.rs +++ b/examples/stm32f4/src/bin/usart_dma.rs | |||
| @@ -5,14 +5,14 @@ | |||
| 5 | use core::fmt::Write; | 5 | use core::fmt::Write; |
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy_stm32::dma::NoDma; | 9 | use embassy_stm32::dma::NoDma; |
| 10 | use embassy_stm32::usart::{Config, Uart}; | 10 | use embassy_stm32::usart::{Config, Uart}; |
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use heapless::String; | 12 | use heapless::String; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | #[embassy::main] | 15 | #[embassy_executor::main] |
| 16 | async fn main(_spawner: Spawner, p: Peripherals) { | 16 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 17 | info!("Hello World!"); | 17 | info!("Hello World!"); |
| 18 | 18 | ||
diff --git a/examples/stm32f4/src/bin/wdt.rs b/examples/stm32f4/src/bin/wdt.rs index bfc487c31..48394f4f1 100644 --- a/examples/stm32f4/src/bin/wdt.rs +++ b/examples/stm32f4/src/bin/wdt.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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::wdg::IndependentWatchdog; | 9 | use embassy_stm32::wdg::IndependentWatchdog; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | info!("Hello World!"); | 15 | info!("Hello World!"); |
| 16 | 16 | ||
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml index b0a548a3f..081bed84f 100644 --- a/examples/stm32f7/Cargo.toml +++ b/examples/stm32f7/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32f7-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] } |
| 9 | embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } | 10 | embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } |
| 10 | embedded-io = { version = "0.3.0", features = ["async"] } | 11 | embedded-io = { version = "0.3.0", features = ["async"] } |
diff --git a/examples/stm32f7/src/bin/adc.rs b/examples/stm32f7/src/bin/adc.rs index fc8359622..2a813c050 100644 --- a/examples/stm32f7/src/bin/adc.rs +++ b/examples/stm32f7/src/bin/adc.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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::{Delay, Duration, Timer}; | 7 | use embassy_executor::time::{Delay, Duration, Timer}; |
| 8 | use embassy_stm32::adc::Adc; | 8 | use embassy_stm32::adc::Adc; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f7/src/bin/blinky.rs b/examples/stm32f7/src/bin/blinky.rs index 907492b3d..f71fe0989 100644 --- a/examples/stm32f7/src/bin/blinky.rs +++ b/examples/stm32f7/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f7/src/bin/button_exti.rs b/examples/stm32f7/src/bin/button_exti.rs index 24ece9927..60dfb362b 100644 --- a/examples/stm32f7/src/bin/button_exti.rs +++ b/examples/stm32f7/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index 177683c3a..33504af76 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -3,9 +3,8 @@ | |||
| 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::util::Forever; | ||
| 9 | use embassy_net::tcp::TcpSocket; | 8 | use embassy_net::tcp::TcpSocket; |
| 10 | use embassy_net::{Ipv4Address, Stack, StackResources}; | 9 | use embassy_net::{Ipv4Address, Stack, StackResources}; |
| 11 | use embassy_stm32::eth::generic_smi::GenericSMI; | 10 | use embassy_stm32::eth::generic_smi::GenericSMI; |
| @@ -14,6 +13,7 @@ use embassy_stm32::peripherals::ETH; | |||
| 14 | use embassy_stm32::rng::Rng; | 13 | use embassy_stm32::rng::Rng; |
| 15 | use embassy_stm32::time::mhz; | 14 | use embassy_stm32::time::mhz; |
| 16 | use embassy_stm32::{interrupt, Config, Peripherals}; | 15 | use embassy_stm32::{interrupt, Config, Peripherals}; |
| 16 | use embassy_util::Forever; | ||
| 17 | use embedded_io::asynch::Write; | 17 | use embedded_io::asynch::Write; |
| 18 | use rand_core::RngCore; | 18 | use rand_core::RngCore; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 19 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -28,7 +28,7 @@ macro_rules! forever { | |||
| 28 | 28 | ||
| 29 | type Device = Ethernet<'static, ETH, GenericSMI, 4, 4>; | 29 | type Device = Ethernet<'static, ETH, GenericSMI, 4, 4>; |
| 30 | 30 | ||
| 31 | #[embassy::task] | 31 | #[embassy_executor::task] |
| 32 | async fn net_task(stack: &'static Stack<Device>) -> ! { | 32 | async fn net_task(stack: &'static Stack<Device>) -> ! { |
| 33 | stack.run().await | 33 | stack.run().await |
| 34 | } | 34 | } |
| @@ -39,7 +39,7 @@ fn config() -> Config { | |||
| 39 | config | 39 | config |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | #[embassy::main(config = "config()")] | 42 | #[embassy_executor::main(config = "config()")] |
| 43 | async fn main(spawner: Spawner, p: Peripherals) -> ! { | 43 | async fn main(spawner: Spawner, p: Peripherals) -> ! { |
| 44 | info!("Hello World!"); | 44 | info!("Hello World!"); |
| 45 | 45 | ||
diff --git a/examples/stm32f7/src/bin/flash.rs b/examples/stm32f7/src/bin/flash.rs index af66275d4..15864cabb 100644 --- a/examples/stm32f7/src/bin/flash.rs +++ b/examples/stm32f7/src/bin/flash.rs | |||
| @@ -3,14 +3,14 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 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_stm32::flash::Flash; | 8 | use embassy_stm32::flash::Flash; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 10 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | info!("Hello Flash!"); | 15 | info!("Hello Flash!"); |
| 16 | 16 | ||
diff --git a/examples/stm32f7/src/bin/hello.rs b/examples/stm32f7/src/bin/hello.rs index 8e69e89d1..f957656ef 100644 --- a/examples/stm32f7/src/bin/hello.rs +++ b/examples/stm32f7/src/bin/hello.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::info; | 5 | use defmt::info; |
| 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_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::{Config, Peripherals}; | 9 | use embassy_stm32::{Config, Peripherals}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -15,7 +15,7 @@ fn config() -> Config { | |||
| 15 | config | 15 | config |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main(config = "config()")] | 18 | #[embassy_executor::main(config = "config()")] |
| 19 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { | 19 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { |
| 20 | loop { | 20 | loop { |
| 21 | info!("Hello World!"); | 21 | info!("Hello World!"); |
diff --git a/examples/stm32f7/src/bin/sdmmc.rs b/examples/stm32f7/src/bin/sdmmc.rs index be1c2b152..1f321df17 100644 --- a/examples/stm32f7/src/bin/sdmmc.rs +++ b/examples/stm32f7/src/bin/sdmmc.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::sdmmc::Sdmmc; | 7 | use embassy_stm32::sdmmc::Sdmmc; |
| 8 | use embassy_stm32::time::mhz; | 8 | use embassy_stm32::time::mhz; |
| 9 | use embassy_stm32::{interrupt, Config, Peripherals}; | 9 | use embassy_stm32::{interrupt, Config, Peripherals}; |
| @@ -15,7 +15,7 @@ fn config() -> Config { | |||
| 15 | config | 15 | config |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main(config = "config()")] | 18 | #[embassy_executor::main(config = "config()")] |
| 19 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { | 19 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { |
| 20 | info!("Hello World!"); | 20 | info!("Hello World!"); |
| 21 | 21 | ||
diff --git a/examples/stm32f7/src/bin/usart_dma.rs b/examples/stm32f7/src/bin/usart_dma.rs index d8551620c..9884d1634 100644 --- a/examples/stm32f7/src/bin/usart_dma.rs +++ b/examples/stm32f7/src/bin/usart_dma.rs | |||
| @@ -5,14 +5,14 @@ | |||
| 5 | use core::fmt::Write; | 5 | use core::fmt::Write; |
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy_stm32::dma::NoDma; | 9 | use embassy_stm32::dma::NoDma; |
| 10 | use embassy_stm32::usart::{Config, Uart}; | 10 | use embassy_stm32::usart::{Config, Uart}; |
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use heapless::String; | 12 | use heapless::String; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | #[embassy::main] | 15 | #[embassy_executor::main] |
| 16 | async fn main(_spawner: Spawner, p: Peripherals) { | 16 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 17 | let config = Config::default(); | 17 | let config = Config::default(); |
| 18 | let mut usart = Uart::new(p.UART7, p.PA8, p.PA15, p.DMA1_CH1, NoDma, config); | 18 | let mut usart = Uart::new(p.UART7, p.PA8, p.PA15, p.DMA1_CH1, NoDma, config); |
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml index bf23fa822..3dedeac63 100644 --- a/examples/stm32g0/Cargo.toml +++ b/examples/stm32g0/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32g0-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } |
| 9 | 10 | ||
| 10 | defmt = "0.3" | 11 | defmt = "0.3" |
diff --git a/examples/stm32g0/src/bin/blinky.rs b/examples/stm32g0/src/bin/blinky.rs index 907492b3d..f71fe0989 100644 --- a/examples/stm32g0/src/bin/blinky.rs +++ b/examples/stm32g0/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32g0/src/bin/button_exti.rs b/examples/stm32g0/src/bin/button_exti.rs index 924feeb33..0832386ed 100644 --- a/examples/stm32g0/src/bin/button_exti.rs +++ b/examples/stm32g0/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml index d3641c489..60c62ad1e 100644 --- a/examples/stm32g4/Cargo.toml +++ b/examples/stm32g4/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32g4-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } |
| 9 | embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" } | 10 | embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" } |
| 10 | 11 | ||
diff --git a/examples/stm32g4/src/bin/blinky.rs b/examples/stm32g4/src/bin/blinky.rs index cd4883276..ea3c563b4 100644 --- a/examples/stm32g4/src/bin/blinky.rs +++ b/examples/stm32g4/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32g4/src/bin/button_exti.rs b/examples/stm32g4/src/bin/button_exti.rs index 24ece9927..60dfb362b 100644 --- a/examples/stm32g4/src/bin/button_exti.rs +++ b/examples/stm32g4/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32g4/src/bin/pwm.rs b/examples/stm32g4/src/bin/pwm.rs index dc4e164ab..7c16d0a3a 100644 --- a/examples/stm32g4/src/bin/pwm.rs +++ b/examples/stm32g4/src/bin/pwm.rs | |||
| @@ -3,15 +3,15 @@ | |||
| 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_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; | 8 | use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; |
| 9 | use embassy_stm32::pwm::Channel; | 9 | use embassy_stm32::pwm::Channel; |
| 10 | use embassy_stm32::time::khz; | 10 | use embassy_stm32::time::khz; |
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | #[embassy::main] | 14 | #[embassy_executor::main] |
| 15 | async fn main(_spawner: Spawner, p: Peripherals) { | 15 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 16 | info!("Hello World!"); | 16 | info!("Hello World!"); |
| 17 | 17 | ||
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index d905031d6..8b1999b30 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32h7-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } |
| 9 | embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } | 10 | embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } |
| 10 | embedded-io = { version = "0.3.0", features = ["async"] } | 11 | embedded-io = { version = "0.3.0", features = ["async"] } |
diff --git a/examples/stm32h7/src/bin/adc.rs b/examples/stm32h7/src/bin/adc.rs index d8a5d23d7..f50976a30 100644 --- a/examples/stm32h7/src/bin/adc.rs +++ b/examples/stm32h7/src/bin/adc.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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::{Delay, Duration, Timer}; | 7 | use embassy_executor::time::{Delay, Duration, Timer}; |
| 8 | use embassy_stm32::adc::{Adc, SampleTime}; | 8 | use embassy_stm32::adc::{Adc, SampleTime}; |
| 9 | use embassy_stm32::rcc::AdcClockSource; | 9 | use embassy_stm32::rcc::AdcClockSource; |
| 10 | use embassy_stm32::time::mhz; | 10 | use embassy_stm32::time::mhz; |
| @@ -20,7 +20,7 @@ pub fn config() -> Config { | |||
| 20 | config | 20 | config |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | #[embassy::main(config = "config()")] | 23 | #[embassy_executor::main(config = "config()")] |
| 24 | async fn main(_spawner: Spawner, mut p: Peripherals) { | 24 | async fn main(_spawner: Spawner, mut p: Peripherals) { |
| 25 | info!("Hello World!"); | 25 | info!("Hello World!"); |
| 26 | 26 | ||
diff --git a/examples/stm32h7/src/bin/blinky.rs b/examples/stm32h7/src/bin/blinky.rs index 7982f4a0b..98ce15cc6 100644 --- a/examples/stm32h7/src/bin/blinky.rs +++ b/examples/stm32h7/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32h7/src/bin/button_exti.rs b/examples/stm32h7/src/bin/button_exti.rs index 24ece9927..60dfb362b 100644 --- a/examples/stm32h7/src/bin/button_exti.rs +++ b/examples/stm32h7/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs index 0d0179e62..69187182f 100644 --- a/examples/stm32h7/src/bin/camera.rs +++ b/examples/stm32h7/src/bin/camera.rs | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use embassy::executor::Spawner; | 5 | use embassy_executor::executor::Spawner; |
| 6 | use embassy::time::{Duration, Timer}; | 6 | use embassy_executor::time::{Duration, Timer}; |
| 7 | use embassy_stm32::dcmi::{self, *}; | 7 | use embassy_stm32::dcmi::{self, *}; |
| 8 | use embassy_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::i2c::I2c; | 9 | use embassy_stm32::i2c::I2c; |
| @@ -32,7 +32,7 @@ const HEIGHT: usize = 100; | |||
| 32 | 32 | ||
| 33 | static mut FRAME: [u32; WIDTH * HEIGHT / 2] = [0u32; WIDTH * HEIGHT / 2]; | 33 | static mut FRAME: [u32; WIDTH * HEIGHT / 2] = [0u32; WIDTH * HEIGHT / 2]; |
| 34 | 34 | ||
| 35 | #[embassy::main(config = "config()")] | 35 | #[embassy_executor::main(config = "config()")] |
| 36 | async fn main(_spawner: Spawner, p: Peripherals) { | 36 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 37 | defmt::info!("Hello World!"); | 37 | defmt::info!("Hello World!"); |
| 38 | let mco = Mco::new(p.MCO1, p.PA8, Mco1Source::Hsi, McoClock::Divided(3)); | 38 | let mco = Mco::new(p.MCO1, p.PA8, Mco1Source::Hsi, McoClock::Divided(3)); |
| @@ -78,7 +78,7 @@ mod ov7725 { | |||
| 78 | use core::marker::PhantomData; | 78 | use core::marker::PhantomData; |
| 79 | 79 | ||
| 80 | use defmt::Format; | 80 | use defmt::Format; |
| 81 | use embassy::time::{Duration, Timer}; | 81 | use embassy_executor::time::{Duration, Timer}; |
| 82 | use embassy_stm32::rcc::{Mco, McoInstance}; | 82 | use embassy_stm32::rcc::{Mco, McoInstance}; |
| 83 | use embedded_hal_async::i2c::I2c; | 83 | use embedded_hal_async::i2c::I2c; |
| 84 | 84 | ||
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 556d472bd..4282fcedd 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -3,9 +3,8 @@ | |||
| 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::util::Forever; | ||
| 9 | use embassy_net::tcp::TcpSocket; | 8 | use embassy_net::tcp::TcpSocket; |
| 10 | use embassy_net::{Ipv4Address, Stack, StackResources}; | 9 | use embassy_net::{Ipv4Address, Stack, StackResources}; |
| 11 | use embassy_stm32::eth::generic_smi::GenericSMI; | 10 | use embassy_stm32::eth::generic_smi::GenericSMI; |
| @@ -14,6 +13,7 @@ use embassy_stm32::peripherals::ETH; | |||
| 14 | use embassy_stm32::rng::Rng; | 13 | use embassy_stm32::rng::Rng; |
| 15 | use embassy_stm32::time::mhz; | 14 | use embassy_stm32::time::mhz; |
| 16 | use embassy_stm32::{interrupt, Config, Peripherals}; | 15 | use embassy_stm32::{interrupt, Config, Peripherals}; |
| 16 | use embassy_util::Forever; | ||
| 17 | use embedded_io::asynch::Write; | 17 | use embedded_io::asynch::Write; |
| 18 | use rand_core::RngCore; | 18 | use rand_core::RngCore; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 19 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -28,7 +28,7 @@ macro_rules! forever { | |||
| 28 | 28 | ||
| 29 | type Device = Ethernet<'static, ETH, GenericSMI, 4, 4>; | 29 | type Device = Ethernet<'static, ETH, GenericSMI, 4, 4>; |
| 30 | 30 | ||
| 31 | #[embassy::task] | 31 | #[embassy_executor::task] |
| 32 | async fn net_task(stack: &'static Stack<Device>) -> ! { | 32 | async fn net_task(stack: &'static Stack<Device>) -> ! { |
| 33 | stack.run().await | 33 | stack.run().await |
| 34 | } | 34 | } |
| @@ -41,7 +41,7 @@ pub fn config() -> Config { | |||
| 41 | config | 41 | config |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | #[embassy::main(config = "config()")] | 44 | #[embassy_executor::main(config = "config()")] |
| 45 | async fn main(spawner: Spawner, p: Peripherals) -> ! { | 45 | async fn main(spawner: Spawner, p: Peripherals) -> ! { |
| 46 | info!("Hello World!"); | 46 | info!("Hello World!"); |
| 47 | 47 | ||
diff --git a/examples/stm32h7/src/bin/flash.rs b/examples/stm32h7/src/bin/flash.rs index 5f97d2b31..0c477deba 100644 --- a/examples/stm32h7/src/bin/flash.rs +++ b/examples/stm32h7/src/bin/flash.rs | |||
| @@ -3,14 +3,14 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 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_stm32::flash::Flash; | 8 | use embassy_stm32::flash::Flash; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 10 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | info!("Hello Flash!"); | 15 | info!("Hello Flash!"); |
| 16 | 16 | ||
diff --git a/examples/stm32h7/src/bin/fmc.rs b/examples/stm32h7/src/bin/fmc.rs index 27c715ab0..5140a6e22 100644 --- a/examples/stm32h7/src/bin/fmc.rs +++ b/examples/stm32h7/src/bin/fmc.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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::{Delay, Duration, Timer}; | 7 | use embassy_executor::time::{Delay, Duration, Timer}; |
| 8 | use embassy_stm32::fmc::Fmc; | 8 | use embassy_stm32::fmc::Fmc; |
| 9 | use embassy_stm32::time::mhz; | 9 | use embassy_stm32::time::mhz; |
| 10 | use embassy_stm32::{Config, Peripherals}; | 10 | use embassy_stm32::{Config, Peripherals}; |
| @@ -18,7 +18,7 @@ pub fn config() -> Config { | |||
| 18 | config | 18 | config |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | #[embassy::main(config = "config()")] | 21 | #[embassy_executor::main(config = "config()")] |
| 22 | async fn main(_spawner: Spawner, p: Peripherals) { | 22 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 23 | info!("Hello World!"); | 23 | info!("Hello World!"); |
| 24 | 24 | ||
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs index d7c6da5bd..f2477c7a7 100644 --- a/examples/stm32h7/src/bin/low_level_timer_api.rs +++ b/examples/stm32h7/src/bin/low_level_timer_api.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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_stm32::gpio::low_level::AFType; | 8 | use embassy_stm32::gpio::low_level::AFType; |
| 9 | use embassy_stm32::gpio::Speed; | 9 | use embassy_stm32::gpio::Speed; |
| 10 | use embassy_stm32::pwm::*; | 10 | use embassy_stm32::pwm::*; |
| @@ -24,7 +24,7 @@ pub fn config() -> Config { | |||
| 24 | config | 24 | config |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy::main(config = "config()")] | 27 | #[embassy_executor::main(config = "config()")] |
| 28 | async fn main(_spawner: Spawner, p: Peripherals) { | 28 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 29 | info!("Hello World!"); | 29 | info!("Hello World!"); |
| 30 | 30 | ||
diff --git a/examples/stm32h7/src/bin/mco.rs b/examples/stm32h7/src/bin/mco.rs index 6f03b5479..83ba3742b 100644 --- a/examples/stm32h7/src/bin/mco.rs +++ b/examples/stm32h7/src/bin/mco.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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::rcc::{Mco, Mco1Source, McoClock}; | 9 | use embassy_stm32::rcc::{Mco, Mco1Source, McoClock}; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | info!("Hello World!"); | 15 | info!("Hello World!"); |
| 16 | 16 | ||
diff --git a/examples/stm32h7/src/bin/pwm.rs b/examples/stm32h7/src/bin/pwm.rs index 730f637e9..36ed2e4a4 100644 --- a/examples/stm32h7/src/bin/pwm.rs +++ b/examples/stm32h7/src/bin/pwm.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; | 8 | use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; |
| 9 | use embassy_stm32::pwm::Channel; | 9 | use embassy_stm32::pwm::Channel; |
| 10 | use embassy_stm32::time::{khz, mhz}; | 10 | use embassy_stm32::time::{khz, mhz}; |
| @@ -23,7 +23,7 @@ pub fn config() -> Config { | |||
| 23 | config | 23 | config |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | #[embassy::main(config = "config()")] | 26 | #[embassy_executor::main(config = "config()")] |
| 27 | async fn main(_spawner: Spawner, p: Peripherals) { | 27 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 28 | info!("Hello World!"); | 28 | info!("Hello World!"); |
| 29 | 29 | ||
diff --git a/examples/stm32h7/src/bin/rng.rs b/examples/stm32h7/src/bin/rng.rs index 2b42a6afd..81fb3d162 100644 --- a/examples/stm32h7/src/bin/rng.rs +++ b/examples/stm32h7/src/bin/rng.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 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_stm32::rng::Rng; | 7 | use embassy_stm32::rng::Rng; |
| 8 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 13 | info!("Hello World!"); | 13 | info!("Hello World!"); |
| 14 | 14 | ||
diff --git a/examples/stm32h7/src/bin/sdmmc.rs b/examples/stm32h7/src/bin/sdmmc.rs index 163807d86..19ae5ade1 100644 --- a/examples/stm32h7/src/bin/sdmmc.rs +++ b/examples/stm32h7/src/bin/sdmmc.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::sdmmc::Sdmmc; | 7 | use embassy_stm32::sdmmc::Sdmmc; |
| 8 | use embassy_stm32::time::mhz; | 8 | use embassy_stm32::time::mhz; |
| 9 | use embassy_stm32::{interrupt, Config, Peripherals}; | 9 | use embassy_stm32::{interrupt, Config, Peripherals}; |
| @@ -15,7 +15,7 @@ fn config() -> Config { | |||
| 15 | config | 15 | config |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main(config = "config()")] | 18 | #[embassy_executor::main(config = "config()")] |
| 19 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { | 19 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { |
| 20 | info!("Hello World!"); | 20 | info!("Hello World!"); |
| 21 | 21 | ||
diff --git a/examples/stm32h7/src/bin/signal.rs b/examples/stm32h7/src/bin/signal.rs index f798b1c92..2fc75c7af 100644 --- a/examples/stm32h7/src/bin/signal.rs +++ b/examples/stm32h7/src/bin/signal.rs | |||
| @@ -3,15 +3,15 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::channel::signal::Signal; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy::time::{Duration, Timer}; | ||
| 9 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use embassy_util::channel::signal::Signal; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | static SIGNAL: Signal<u32> = Signal::new(); | 12 | static SIGNAL: Signal<u32> = Signal::new(); |
| 13 | 13 | ||
| 14 | #[embassy::task] | 14 | #[embassy_executor::task] |
| 15 | async fn my_sending_task() { | 15 | async fn my_sending_task() { |
| 16 | let mut counter: u32 = 0; | 16 | let mut counter: u32 = 0; |
| 17 | 17 | ||
| @@ -24,7 +24,7 @@ async fn my_sending_task() { | |||
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy::main] | 27 | #[embassy_executor::main] |
| 28 | async fn main(spawner: Spawner, _p: Peripherals) { | 28 | async fn main(spawner: Spawner, _p: Peripherals) { |
| 29 | unwrap!(spawner.spawn(my_sending_task())); | 29 | unwrap!(spawner.spawn(my_sending_task())); |
| 30 | 30 | ||
diff --git a/examples/stm32h7/src/bin/spi.rs b/examples/stm32h7/src/bin/spi.rs index f2eb5a3be..dc8cb7f47 100644 --- a/examples/stm32h7/src/bin/spi.rs +++ b/examples/stm32h7/src/bin/spi.rs | |||
| @@ -7,12 +7,12 @@ use core::str::from_utf8; | |||
| 7 | 7 | ||
| 8 | use cortex_m_rt::entry; | 8 | use cortex_m_rt::entry; |
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy::executor::Executor; | 10 | use embassy_executor::executor::Executor; |
| 11 | use embassy::util::Forever; | ||
| 12 | use embassy_stm32::dma::NoDma; | 11 | use embassy_stm32::dma::NoDma; |
| 13 | use embassy_stm32::peripherals::SPI3; | 12 | use embassy_stm32::peripherals::SPI3; |
| 14 | use embassy_stm32::time::mhz; | 13 | use embassy_stm32::time::mhz; |
| 15 | use embassy_stm32::{spi, Config}; | 14 | use embassy_stm32::{spi, Config}; |
| 15 | use embassy_util::Forever; | ||
| 16 | use heapless::String; | 16 | use heapless::String; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | 18 | ||
| @@ -24,7 +24,7 @@ pub fn config() -> Config { | |||
| 24 | config | 24 | config |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy::task] | 27 | #[embassy_executor::task] |
| 28 | async fn main_task(mut spi: spi::Spi<'static, SPI3, NoDma, NoDma>) { | 28 | async fn main_task(mut spi: spi::Spi<'static, SPI3, NoDma, NoDma>) { |
| 29 | for n in 0u32.. { | 29 | for n in 0u32.. { |
| 30 | let mut write: String<128> = String::new(); | 30 | let mut write: String<128> = String::new(); |
diff --git a/examples/stm32h7/src/bin/spi_dma.rs b/examples/stm32h7/src/bin/spi_dma.rs index d72051fda..2631ed30c 100644 --- a/examples/stm32h7/src/bin/spi_dma.rs +++ b/examples/stm32h7/src/bin/spi_dma.rs | |||
| @@ -7,11 +7,11 @@ use core::str::from_utf8; | |||
| 7 | 7 | ||
| 8 | use cortex_m_rt::entry; | 8 | use cortex_m_rt::entry; |
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy::executor::Executor; | 10 | use embassy_executor::executor::Executor; |
| 11 | use embassy::util::Forever; | ||
| 12 | use embassy_stm32::peripherals::{DMA1_CH3, DMA1_CH4, SPI3}; | 11 | use embassy_stm32::peripherals::{DMA1_CH3, DMA1_CH4, SPI3}; |
| 13 | use embassy_stm32::time::mhz; | 12 | use embassy_stm32::time::mhz; |
| 14 | use embassy_stm32::{spi, Config}; | 13 | use embassy_stm32::{spi, Config}; |
| 14 | use embassy_util::Forever; | ||
| 15 | use heapless::String; | 15 | use heapless::String; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| @@ -23,7 +23,7 @@ pub fn config() -> Config { | |||
| 23 | config | 23 | config |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | #[embassy::task] | 26 | #[embassy_executor::task] |
| 27 | async fn main_task(mut spi: spi::Spi<'static, SPI3, DMA1_CH3, DMA1_CH4>) { | 27 | async fn main_task(mut spi: spi::Spi<'static, SPI3, DMA1_CH3, DMA1_CH4>) { |
| 28 | for n in 0u32.. { | 28 | for n in 0u32.. { |
| 29 | let mut write: String<128> = String::new(); | 29 | let mut write: String<128> = String::new(); |
diff --git a/examples/stm32h7/src/bin/usart.rs b/examples/stm32h7/src/bin/usart.rs index fc3db5a33..e491fb39d 100644 --- a/examples/stm32h7/src/bin/usart.rs +++ b/examples/stm32h7/src/bin/usart.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | use cortex_m_rt::entry; | 5 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy::executor::Executor; | 7 | use embassy_executor::executor::Executor; |
| 8 | use embassy::util::Forever; | ||
| 9 | use embassy_stm32::dma::NoDma; | 8 | use embassy_stm32::dma::NoDma; |
| 10 | use embassy_stm32::usart::{Config, Uart}; | 9 | use embassy_stm32::usart::{Config, Uart}; |
| 10 | use embassy_util::Forever; | ||
| 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 main_task() { | 14 | async fn main_task() { |
| 15 | let p = embassy_stm32::init(Default::default()); | 15 | let p = embassy_stm32::init(Default::default()); |
| 16 | 16 | ||
diff --git a/examples/stm32h7/src/bin/usart_dma.rs b/examples/stm32h7/src/bin/usart_dma.rs index d3325b0c1..aacda45bc 100644 --- a/examples/stm32h7/src/bin/usart_dma.rs +++ b/examples/stm32h7/src/bin/usart_dma.rs | |||
| @@ -6,14 +6,14 @@ use core::fmt::Write; | |||
| 6 | 6 | ||
| 7 | use cortex_m_rt::entry; | 7 | use cortex_m_rt::entry; |
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy::executor::Executor; | 9 | use embassy_executor::executor::Executor; |
| 10 | use embassy::util::Forever; | ||
| 11 | use embassy_stm32::dma::NoDma; | 10 | use embassy_stm32::dma::NoDma; |
| 12 | use embassy_stm32::usart::{Config, Uart}; | 11 | use embassy_stm32::usart::{Config, Uart}; |
| 12 | use embassy_util::Forever; | ||
| 13 | use heapless::String; | 13 | use heapless::String; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | #[embassy::task] | 16 | #[embassy_executor::task] |
| 17 | async fn main_task() { | 17 | async fn main_task() { |
| 18 | let p = embassy_stm32::init(Default::default()); | 18 | let p = embassy_stm32::init(Default::default()); |
| 19 | 19 | ||
diff --git a/examples/stm32h7/src/bin/usart_split.rs b/examples/stm32h7/src/bin/usart_split.rs index 678d8c911..12bb0ce9c 100644 --- a/examples/stm32h7/src/bin/usart_split.rs +++ b/examples/stm32h7/src/bin/usart_split.rs | |||
| @@ -3,16 +3,16 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy::blocking_mutex::raw::ThreadModeRawMutex; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy::channel::mpmc::Channel; | ||
| 8 | use embassy::executor::Spawner; | ||
| 9 | use embassy_stm32::dma::NoDma; | 7 | use embassy_stm32::dma::NoDma; |
| 10 | use embassy_stm32::peripherals::{DMA1_CH1, UART7}; | 8 | use embassy_stm32::peripherals::{DMA1_CH1, UART7}; |
| 11 | use embassy_stm32::usart::{Config, Uart, UartRx}; | 9 | use embassy_stm32::usart::{Config, Uart, UartRx}; |
| 12 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 12 | use embassy_util::channel::mpmc::Channel; | ||
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | #[embassy::task] | 15 | #[embassy_executor::task] |
| 16 | async fn writer(mut usart: Uart<'static, UART7, NoDma, NoDma>) { | 16 | async fn writer(mut usart: Uart<'static, UART7, NoDma, NoDma>) { |
| 17 | unwrap!(usart.blocking_write(b"Hello Embassy World!\r\n")); | 17 | unwrap!(usart.blocking_write(b"Hello Embassy World!\r\n")); |
| 18 | info!("wrote Hello, starting echo"); | 18 | info!("wrote Hello, starting echo"); |
| @@ -26,7 +26,7 @@ async fn writer(mut usart: Uart<'static, UART7, NoDma, NoDma>) { | |||
| 26 | 26 | ||
| 27 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); | 27 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); |
| 28 | 28 | ||
| 29 | #[embassy::main] | 29 | #[embassy_executor::main] |
| 30 | async fn main(spawner: Spawner, p: Peripherals) -> ! { | 30 | async fn main(spawner: Spawner, p: Peripherals) -> ! { |
| 31 | info!("Hello World!"); | 31 | info!("Hello World!"); |
| 32 | 32 | ||
| @@ -45,7 +45,7 @@ async fn main(spawner: Spawner, p: Peripherals) -> ! { | |||
| 45 | } | 45 | } |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | #[embassy::task] | 48 | #[embassy_executor::task] |
| 49 | async fn reader(mut rx: UartRx<'static, UART7, DMA1_CH1>) { | 49 | async fn reader(mut rx: UartRx<'static, UART7, DMA1_CH1>) { |
| 50 | let mut buf = [0; 8]; | 50 | let mut buf = [0; 8]; |
| 51 | loop { | 51 | loop { |
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index d6093963b..7edda042d 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml | |||
| @@ -8,7 +8,8 @@ default = ["nightly"] | |||
| 8 | nightly = ["embassy-stm32/nightly", "embassy-lora", "lorawan-device", "lorawan", "embedded-io/async"] | 8 | nightly = ["embassy-stm32/nightly", "embassy-lora", "lorawan-device", "lorawan", "embedded-io/async"] |
| 9 | 9 | ||
| 10 | [dependencies] | 10 | [dependencies] |
| 11 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 11 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 12 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 12 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 13 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] } |
| 13 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["sx127x", "time", "defmt"], optional = true} | 14 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["sx127x", "time", "defmt"], optional = true} |
| 14 | 15 | ||
diff --git a/examples/stm32l0/src/bin/blinky.rs b/examples/stm32l0/src/bin/blinky.rs index e027192bc..8cf21effb 100644 --- a/examples/stm32l0/src/bin/blinky.rs +++ b/examples/stm32l0/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32l0/src/bin/button.rs b/examples/stm32l0/src/bin/button.rs index 43ea8c2a5..a5e05c3a3 100644 --- a/examples/stm32l0/src/bin/button.rs +++ b/examples/stm32l0/src/bin/button.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 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_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 7 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| 8 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 13 | info!("Hello World!"); | 13 | info!("Hello World!"); |
| 14 | 14 | ||
diff --git a/examples/stm32l0/src/bin/button_exti.rs b/examples/stm32l0/src/bin/button_exti.rs index d87870a01..22a096af8 100644 --- a/examples/stm32l0/src/bin/button_exti.rs +++ b/examples/stm32l0/src/bin/button_exti.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| @@ -15,7 +15,7 @@ fn config() -> embassy_stm32::Config { | |||
| 15 | config | 15 | config |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #[embassy::main(config = "config()")] | 18 | #[embassy_executor::main(config = "config()")] |
| 19 | async fn main(_spawner: Spawner, p: Peripherals) { | 19 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 20 | let button = Input::new(p.PB2, Pull::Up); | 20 | let button = Input::new(p.PB2, Pull::Up); |
| 21 | let mut button = ExtiInput::new(button, p.EXTI2); | 21 | let mut button = ExtiInput::new(button, p.EXTI2); |
diff --git a/examples/stm32l0/src/bin/flash.rs b/examples/stm32l0/src/bin/flash.rs index a2fec9291..7ad5ae3aa 100644 --- a/examples/stm32l0/src/bin/flash.rs +++ b/examples/stm32l0/src/bin/flash.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_stm32::flash::Flash; | 7 | use embassy_stm32::flash::Flash; |
| 8 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello Flash!"); | 14 | info!("Hello Flash!"); |
| 15 | 15 | ||
diff --git a/examples/stm32l0/src/bin/lorawan.rs b/examples/stm32l0/src/bin/lorawan.rs index da58e2f72..29e54c1be 100644 --- a/examples/stm32l0/src/bin/lorawan.rs +++ b/examples/stm32l0/src/bin/lorawan.rs | |||
| @@ -24,8 +24,8 @@ fn config() -> embassy_stm32::Config { | |||
| 24 | config | 24 | config |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy::main(config = "config()")] | 27 | #[embassy_executor::main(config = "config()")] |
| 28 | async fn main(_spawner: embassy::executor::Spawner, p: Peripherals) { | 28 | async fn main(_spawner: embassy_executor::executor::Spawner, p: Peripherals) { |
| 29 | // SPI for sx127x | 29 | // SPI for sx127x |
| 30 | let spi = spi::Spi::new( | 30 | let spi = spi::Spi::new( |
| 31 | p.SPI1, | 31 | p.SPI1, |
diff --git a/examples/stm32l0/src/bin/raw_spawn.rs b/examples/stm32l0/src/bin/raw_spawn.rs index dfe2cddb6..cd711a430 100644 --- a/examples/stm32l0/src/bin/raw_spawn.rs +++ b/examples/stm32l0/src/bin/raw_spawn.rs | |||
| @@ -5,10 +5,10 @@ use core::mem; | |||
| 5 | 5 | ||
| 6 | use cortex_m_rt::entry; | 6 | use cortex_m_rt::entry; |
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy::executor::raw::TaskStorage; | 8 | use embassy_executor::executor::raw::TaskStorage; |
| 9 | use embassy::executor::Executor; | 9 | use embassy_executor::executor::Executor; |
| 10 | use embassy::time::{Duration, Timer}; | 10 | use embassy_executor::time::{Duration, Timer}; |
| 11 | use embassy::util::Forever; | 11 | use embassy_util::Forever; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | async fn run1() { | 14 | async fn run1() { |
diff --git a/examples/stm32l0/src/bin/spi.rs b/examples/stm32l0/src/bin/spi.rs index dba0b281d..74694295c 100644 --- a/examples/stm32l0/src/bin/spi.rs +++ b/examples/stm32l0/src/bin/spi.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::dma::NoDma; | 7 | use embassy_stm32::dma::NoDma; |
| 8 | use embassy_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::spi::{Config, Spi}; | 9 | use embassy_stm32::spi::{Config, Spi}; |
| @@ -11,7 +11,7 @@ use embassy_stm32::time::Hertz; | |||
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | #[embassy::main] | 14 | #[embassy_executor::main] |
| 15 | async fn main(_spawner: Spawner, p: Peripherals) { | 15 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 16 | info!("Hello World, folks!"); | 16 | info!("Hello World, folks!"); |
| 17 | 17 | ||
diff --git a/examples/stm32l0/src/bin/usart_dma.rs b/examples/stm32l0/src/bin/usart_dma.rs index 861241639..1c5ce94d7 100644 --- a/examples/stm32l0/src/bin/usart_dma.rs +++ b/examples/stm32l0/src/bin/usart_dma.rs | |||
| @@ -3,12 +3,12 @@ | |||
| 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_stm32::usart::{Config, Uart}; | 7 | use embassy_stm32::usart::{Config, Uart}; |
| 8 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[embassy::main] | 11 | #[embassy_executor::main] |
| 12 | async fn main(_spawner: Spawner, p: Peripherals) { | 12 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 13 | let mut usart = Uart::new(p.USART1, p.PB7, p.PB6, p.DMA1_CH2, p.DMA1_CH3, Config::default()); | 13 | let mut usart = Uart::new(p.USART1, p.PB7, p.PB6, p.DMA1_CH2, p.DMA1_CH3, Config::default()); |
| 14 | 14 | ||
diff --git a/examples/stm32l0/src/bin/usart_irq.rs b/examples/stm32l0/src/bin/usart_irq.rs index 09b1b0b03..b77d97f85 100644 --- a/examples/stm32l0/src/bin/usart_irq.rs +++ b/examples/stm32l0/src/bin/usart_irq.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_stm32::dma::NoDma; | 7 | use embassy_stm32::dma::NoDma; |
| 8 | use embassy_stm32::usart::{BufferedUart, Config, State, Uart}; | 8 | use embassy_stm32::usart::{BufferedUart, Config, State, Uart}; |
| 9 | use embassy_stm32::{interrupt, Peripherals}; | 9 | use embassy_stm32::{interrupt, Peripherals}; |
| 10 | use embedded_io::asynch::{Read, Write}; | 10 | use embedded_io::asynch::{Read, Write}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | info!("Hi!"); | 15 | info!("Hi!"); |
| 16 | 16 | ||
diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml index 7fec60575..d69de9c53 100644 --- a/examples/stm32l1/Cargo.toml +++ b/examples/stm32l1/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32l1-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } |
| 9 | 10 | ||
| 10 | defmt = "0.3" | 11 | defmt = "0.3" |
diff --git a/examples/stm32l1/src/bin/blinky.rs b/examples/stm32l1/src/bin/blinky.rs index bace53d91..58306be94 100644 --- a/examples/stm32l1/src/bin/blinky.rs +++ b/examples/stm32l1/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32l1/src/bin/flash.rs b/examples/stm32l1/src/bin/flash.rs index fc519b079..78938fe3e 100644 --- a/examples/stm32l1/src/bin/flash.rs +++ b/examples/stm32l1/src/bin/flash.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_stm32::flash::Flash; | 7 | use embassy_stm32::flash::Flash; |
| 8 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello Flash!"); | 14 | info!("Hello Flash!"); |
| 15 | 15 | ||
diff --git a/examples/stm32l1/src/bin/spi.rs b/examples/stm32l1/src/bin/spi.rs index 81ccba4e1..05e869e71 100644 --- a/examples/stm32l1/src/bin/spi.rs +++ b/examples/stm32l1/src/bin/spi.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::dma::NoDma; | 7 | use embassy_stm32::dma::NoDma; |
| 8 | use embassy_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::spi::{Config, Spi}; | 9 | use embassy_stm32::spi::{Config, Spi}; |
| @@ -11,7 +11,7 @@ use embassy_stm32::time::Hertz; | |||
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | #[embassy::main] | 14 | #[embassy_executor::main] |
| 15 | async fn main(_spawner: Spawner, p: Peripherals) { | 15 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 16 | info!("Hello World, folks!"); | 16 | info!("Hello World, folks!"); |
| 17 | 17 | ||
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml index 7d89bf94a..8ac974c92 100644 --- a/examples/stm32l4/Cargo.toml +++ b/examples/stm32l4/Cargo.toml | |||
| @@ -6,7 +6,8 @@ version = "0.1.0" | |||
| 6 | [features] | 6 | [features] |
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 9 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 10 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 10 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 11 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5vi", "time-driver-any", "exti", "unstable-traits"] } | 12 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5vi", "time-driver-any", "exti", "unstable-traits"] } |
| 12 | 13 | ||
diff --git a/examples/stm32l4/src/bin/adc.rs b/examples/stm32l4/src/bin/adc.rs index 499ea47dc..93a20d5ea 100644 --- a/examples/stm32l4/src/bin/adc.rs +++ b/examples/stm32l4/src/bin/adc.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::*; | 5 | use defmt::*; |
| 6 | use embassy::time::Delay; | 6 | use embassy_executor::time::Delay; |
| 7 | use embassy_stm32::adc::{Adc, Resolution}; | 7 | use embassy_stm32::adc::{Adc, Resolution}; |
| 8 | use embassy_stm32::pac; | 8 | use embassy_stm32::pac; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/stm32l4/src/bin/blinky.rs b/examples/stm32l4/src/bin/blinky.rs index 54f8e03b2..3d689b5ee 100644 --- a/examples/stm32l4/src/bin/blinky.rs +++ b/examples/stm32l4/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32l4/src/bin/button_exti.rs b/examples/stm32l4/src/bin/button_exti.rs index 924feeb33..0832386ed 100644 --- a/examples/stm32l4/src/bin/button_exti.rs +++ b/examples/stm32l4/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32l4/src/bin/i2c.rs b/examples/stm32l4/src/bin/i2c.rs index a22b52184..058529ecf 100644 --- a/examples/stm32l4/src/bin/i2c.rs +++ b/examples/stm32l4/src/bin/i2c.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::dma::NoDma; | 7 | use embassy_stm32::dma::NoDma; |
| 8 | use embassy_stm32::i2c::I2c; | 8 | use embassy_stm32::i2c::I2c; |
| 9 | use embassy_stm32::time::Hertz; | 9 | use embassy_stm32::time::Hertz; |
| @@ -13,7 +13,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 13 | const ADDRESS: u8 = 0x5F; | 13 | const ADDRESS: u8 = 0x5F; |
| 14 | const WHOAMI: u8 = 0x0F; | 14 | const WHOAMI: u8 = 0x0F; |
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy_executor::main] |
| 17 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { | 17 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { |
| 18 | let irq = interrupt::take!(I2C2_EV); | 18 | let irq = interrupt::take!(I2C2_EV); |
| 19 | let mut i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, NoDma, NoDma, Hertz(100_000)); | 19 | let mut i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, NoDma, NoDma, Hertz(100_000)); |
diff --git a/examples/stm32l4/src/bin/i2c_blocking_async.rs b/examples/stm32l4/src/bin/i2c_blocking_async.rs index 6c4a86703..2dae9c2d5 100644 --- a/examples/stm32l4/src/bin/i2c_blocking_async.rs +++ b/examples/stm32l4/src/bin/i2c_blocking_async.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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; | ||
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 6 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 7 | use embassy_executor::executor::Spawner; | ||
| 8 | use embassy_stm32::dma::NoDma; | 8 | use embassy_stm32::dma::NoDma; |
| 9 | use embassy_stm32::i2c::I2c; | 9 | use embassy_stm32::i2c::I2c; |
| 10 | use embassy_stm32::time::Hertz; | 10 | use embassy_stm32::time::Hertz; |
| @@ -15,7 +15,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 15 | const ADDRESS: u8 = 0x5F; | 15 | const ADDRESS: u8 = 0x5F; |
| 16 | const WHOAMI: u8 = 0x0F; | 16 | const WHOAMI: u8 = 0x0F; |
| 17 | 17 | ||
| 18 | #[embassy::main] | 18 | #[embassy_executor::main] |
| 19 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { | 19 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { |
| 20 | let irq = interrupt::take!(I2C2_EV); | 20 | let irq = interrupt::take!(I2C2_EV); |
| 21 | let i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, NoDma, NoDma, Hertz(100_000)); | 21 | let i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, NoDma, NoDma, Hertz(100_000)); |
diff --git a/examples/stm32l4/src/bin/i2c_dma.rs b/examples/stm32l4/src/bin/i2c_dma.rs index 48d2e92cf..9e71d404b 100644 --- a/examples/stm32l4/src/bin/i2c_dma.rs +++ b/examples/stm32l4/src/bin/i2c_dma.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::i2c::I2c; | 7 | use embassy_stm32::i2c::I2c; |
| 8 | use embassy_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::{interrupt, Peripherals}; | 9 | use embassy_stm32::{interrupt, Peripherals}; |
| @@ -12,7 +12,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 12 | const ADDRESS: u8 = 0x5F; | 12 | const ADDRESS: u8 = 0x5F; |
| 13 | const WHOAMI: u8 = 0x0F; | 13 | const WHOAMI: u8 = 0x0F; |
| 14 | 14 | ||
| 15 | #[embassy::main] | 15 | #[embassy_executor::main] |
| 16 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { | 16 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { |
| 17 | let irq = interrupt::take!(I2C2_EV); | 17 | let irq = interrupt::take!(I2C2_EV); |
| 18 | let mut i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, p.DMA1_CH4, p.DMA1_CH5, Hertz(100_000)); | 18 | let mut i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, p.DMA1_CH4, p.DMA1_CH5, Hertz(100_000)); |
diff --git a/examples/stm32l4/src/bin/rng.rs b/examples/stm32l4/src/bin/rng.rs index 7aaa122ed..ed47fc6c9 100644 --- a/examples/stm32l4/src/bin/rng.rs +++ b/examples/stm32l4/src/bin/rng.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::rcc::{ClockSrc, PLLClkDiv, PLLMul, PLLSource, PLLSrcDiv}; | 7 | use embassy_stm32::rcc::{ClockSrc, PLLClkDiv, PLLMul, PLLSource, PLLSrcDiv}; |
| 8 | use embassy_stm32::rng::Rng; | 8 | use embassy_stm32::rng::Rng; |
| 9 | use embassy_stm32::{Config, Peripherals}; | 9 | use embassy_stm32::{Config, Peripherals}; |
| @@ -22,7 +22,7 @@ fn config() -> Config { | |||
| 22 | config | 22 | config |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | #[embassy::main(config = "config()")] | 25 | #[embassy_executor::main(config = "config()")] |
| 26 | async fn main(_spawner: Spawner, p: Peripherals) { | 26 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 27 | info!("Hello World!"); | 27 | info!("Hello World!"); |
| 28 | 28 | ||
diff --git a/examples/stm32l4/src/bin/spi_blocking_async.rs b/examples/stm32l4/src/bin/spi_blocking_async.rs index 20a2ff802..e06b29b81 100644 --- a/examples/stm32l4/src/bin/spi_blocking_async.rs +++ b/examples/stm32l4/src/bin/spi_blocking_async.rs | |||
| @@ -3,8 +3,8 @@ | |||
| 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; | ||
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 6 | use embassy_embedded_hal::adapter::BlockingAsync; |
| 7 | use embassy_executor::executor::Spawner; | ||
| 8 | use embassy_stm32::dma::NoDma; | 8 | use embassy_stm32::dma::NoDma; |
| 9 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 9 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| 10 | use embassy_stm32::spi::{Config, Spi}; | 10 | use embassy_stm32::spi::{Config, Spi}; |
| @@ -13,7 +13,7 @@ use embassy_stm32::Peripherals; | |||
| 13 | use embedded_hal_async::spi::SpiBus; | 13 | use embedded_hal_async::spi::SpiBus; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy_executor::main] |
| 17 | async fn main(_spawner: Spawner, p: Peripherals) { | 17 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 18 | info!("Hello World!"); | 18 | info!("Hello World!"); |
| 19 | 19 | ||
diff --git a/examples/stm32l4/src/bin/spi_dma.rs b/examples/stm32l4/src/bin/spi_dma.rs index d0c3609af..e44754bec 100644 --- a/examples/stm32l4/src/bin/spi_dma.rs +++ b/examples/stm32l4/src/bin/spi_dma.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_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 7 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| 8 | use embassy_stm32::spi::{Config, Spi}; | 8 | use embassy_stm32::spi::{Config, Spi}; |
| 9 | use embassy_stm32::time::Hertz; | 9 | use embassy_stm32::time::Hertz; |
| 10 | use embassy_stm32::Peripherals; | 10 | use embassy_stm32::Peripherals; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | #[embassy::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner, p: Peripherals) { | 14 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 15 | info!("Hello World!"); | 15 | info!("Hello World!"); |
| 16 | 16 | ||
diff --git a/examples/stm32l4/src/bin/usart_dma.rs b/examples/stm32l4/src/bin/usart_dma.rs index 7ae7e9e15..fdd5a85e6 100644 --- a/examples/stm32l4/src/bin/usart_dma.rs +++ b/examples/stm32l4/src/bin/usart_dma.rs | |||
| @@ -5,14 +5,14 @@ | |||
| 5 | use core::fmt::Write; | 5 | use core::fmt::Write; |
| 6 | 6 | ||
| 7 | use defmt::*; | 7 | use defmt::*; |
| 8 | use embassy::executor::Spawner; | 8 | use embassy_executor::executor::Spawner; |
| 9 | use embassy_stm32::dma::NoDma; | 9 | use embassy_stm32::dma::NoDma; |
| 10 | use embassy_stm32::usart::{Config, Uart}; | 10 | use embassy_stm32::usart::{Config, Uart}; |
| 11 | use embassy_stm32::Peripherals; | 11 | use embassy_stm32::Peripherals; |
| 12 | use heapless::String; | 12 | use heapless::String; |
| 13 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 14 | 14 | ||
| 15 | #[embassy::main] | 15 | #[embassy_executor::main] |
| 16 | async fn main(_spawner: Spawner, p: Peripherals) { | 16 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 17 | info!("Hello World!"); | 17 | info!("Hello World!"); |
| 18 | 18 | ||
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml index 85eac7b8f..6466994ed 100644 --- a/examples/stm32l5/Cargo.toml +++ b/examples/stm32l5/Cargo.toml | |||
| @@ -6,7 +6,8 @@ version = "0.1.0" | |||
| 6 | [features] | 6 | [features] |
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 9 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 10 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } |
| 11 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 12 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } | 13 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } |
diff --git a/examples/stm32l5/src/bin/button_exti.rs b/examples/stm32l5/src/bin/button_exti.rs index c7a6cfa28..99462e597 100644 --- a/examples/stm32l5/src/bin/button_exti.rs +++ b/examples/stm32l5/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32l5/src/bin/rng.rs b/examples/stm32l5/src/bin/rng.rs index d3627d2c2..45094374b 100644 --- a/examples/stm32l5/src/bin/rng.rs +++ b/examples/stm32l5/src/bin/rng.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 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_stm32::rcc::{ClockSrc, PLLClkDiv, PLLMul, PLLSource, PLLSrcDiv}; | 7 | use embassy_stm32::rcc::{ClockSrc, PLLClkDiv, PLLMul, PLLSource, PLLSrcDiv}; |
| 8 | use embassy_stm32::rng::Rng; | 8 | use embassy_stm32::rng::Rng; |
| 9 | use embassy_stm32::{Config, Peripherals}; | 9 | use embassy_stm32::{Config, Peripherals}; |
| @@ -21,7 +21,7 @@ fn config() -> Config { | |||
| 21 | config | 21 | config |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | #[embassy::main(config = "config()")] | 24 | #[embassy_executor::main(config = "config()")] |
| 25 | async fn main(_spawner: Spawner, p: Peripherals) { | 25 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 26 | info!("Hello World!"); | 26 | info!("Hello World!"); |
| 27 | 27 | ||
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs index d711616ef..9e1df15dd 100644 --- a/examples/stm32l5/src/bin/usb_ethernet.rs +++ b/examples/stm32l5/src/bin/usb_ethernet.rs | |||
| @@ -7,10 +7,7 @@ use core::sync::atomic::{AtomicBool, Ordering}; | |||
| 7 | use core::task::Waker; | 7 | use core::task::Waker; |
| 8 | 8 | ||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy::blocking_mutex::raw::ThreadModeRawMutex; | 10 | use embassy_executor::executor::Spawner; |
| 11 | use embassy::channel::mpmc::Channel; | ||
| 12 | use embassy::executor::Spawner; | ||
| 13 | use embassy::util::Forever; | ||
| 14 | use embassy_net::tcp::TcpSocket; | 11 | use embassy_net::tcp::TcpSocket; |
| 15 | use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; | 12 | use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; |
| 16 | use embassy_stm32::rcc::*; | 13 | use embassy_stm32::rcc::*; |
| @@ -20,6 +17,9 @@ use embassy_stm32::usb::Driver; | |||
| 20 | use embassy_stm32::{interrupt, Config, Peripherals}; | 17 | use embassy_stm32::{interrupt, Config, Peripherals}; |
| 21 | use embassy_usb::{Builder, UsbDevice}; | 18 | use embassy_usb::{Builder, UsbDevice}; |
| 22 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; | 19 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; |
| 20 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 21 | use embassy_util::channel::mpmc::Channel; | ||
| 22 | use embassy_util::Forever; | ||
| 23 | use embedded_io::asynch::{Read, Write}; | 23 | use embedded_io::asynch::{Read, Write}; |
| 24 | use rand_core::RngCore; | 24 | use rand_core::RngCore; |
| 25 | use {defmt_rtt as _, panic_probe as _}; | 25 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -34,12 +34,12 @@ macro_rules! forever { | |||
| 34 | }}; | 34 | }}; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | #[embassy::task] | 37 | #[embassy_executor::task] |
| 38 | async fn usb_task(mut device: UsbDevice<'static, MyDriver>) -> ! { | 38 | async fn usb_task(mut device: UsbDevice<'static, MyDriver>) -> ! { |
| 39 | device.run().await | 39 | device.run().await |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | #[embassy::task] | 42 | #[embassy_executor::task] |
| 43 | async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) { | 43 | async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) { |
| 44 | loop { | 44 | loop { |
| 45 | warn!("WAITING for connection"); | 45 | warn!("WAITING for connection"); |
| @@ -68,7 +68,7 @@ async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) { | |||
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | #[embassy::task] | 71 | #[embassy_executor::task] |
| 72 | async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) { | 72 | async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) { |
| 73 | loop { | 73 | loop { |
| 74 | let pkt = TX_CHANNEL.recv().await; | 74 | let pkt = TX_CHANNEL.recv().await; |
| @@ -78,7 +78,7 @@ async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) { | |||
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | #[embassy::task] | 81 | #[embassy_executor::task] |
| 82 | async fn net_task(stack: &'static Stack<Device>) -> ! { | 82 | async fn net_task(stack: &'static Stack<Device>) -> ! { |
| 83 | stack.run().await | 83 | stack.run().await |
| 84 | } | 84 | } |
| @@ -93,7 +93,7 @@ fn config() -> Config { | |||
| 93 | config | 93 | config |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | #[embassy::main(config = "config()")] | 96 | #[embassy_executor::main(config = "config()")] |
| 97 | async fn main(spawner: Spawner, p: Peripherals) { | 97 | async fn main(spawner: Spawner, p: Peripherals) { |
| 98 | // Create the driver, from the HAL. | 98 | // Create the driver, from the HAL. |
| 99 | let irq = interrupt::take!(USB_FS); | 99 | let irq = interrupt::take!(USB_FS); |
diff --git a/examples/stm32l5/src/bin/usb_hid_mouse.rs b/examples/stm32l5/src/bin/usb_hid_mouse.rs index d139e6bb1..6aac00881 100644 --- a/examples/stm32l5/src/bin/usb_hid_mouse.rs +++ b/examples/stm32l5/src/bin/usb_hid_mouse.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | #![feature(type_alias_impl_trait)] | 4 | #![feature(type_alias_impl_trait)] |
| 5 | 5 | ||
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy::executor::Spawner; | 7 | use embassy_executor::executor::Spawner; |
| 8 | use embassy::time::{Duration, Timer}; | 8 | use embassy_executor::time::{Duration, Timer}; |
| 9 | use embassy_stm32::rcc::*; | 9 | use embassy_stm32::rcc::*; |
| 10 | use embassy_stm32::time::Hertz; | 10 | use embassy_stm32::time::Hertz; |
| 11 | use embassy_stm32::usb::Driver; | 11 | use embassy_stm32::usb::Driver; |
| @@ -27,7 +27,7 @@ fn config() -> Config { | |||
| 27 | config | 27 | config |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | #[embassy::main(config = "config()")] | 30 | #[embassy_executor::main(config = "config()")] |
| 31 | async fn main(_spawner: Spawner, p: Peripherals) { | 31 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 32 | // Create the driver, from the HAL. | 32 | // Create the driver, from the HAL. |
| 33 | let irq = interrupt::take!(USB_FS); | 33 | let irq = interrupt::take!(USB_FS); |
diff --git a/examples/stm32l5/src/bin/usb_serial.rs b/examples/stm32l5/src/bin/usb_serial.rs index 8dab001c6..508bce8a8 100644 --- a/examples/stm32l5/src/bin/usb_serial.rs +++ b/examples/stm32l5/src/bin/usb_serial.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{panic, *}; | 5 | use defmt::{panic, *}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_stm32::rcc::*; | 7 | use embassy_stm32::rcc::*; |
| 8 | use embassy_stm32::time::Hertz; | 8 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::usb::{Driver, Instance}; | 9 | use embassy_stm32::usb::{Driver, Instance}; |
| @@ -24,7 +24,7 @@ fn config() -> Config { | |||
| 24 | config | 24 | config |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy::main(config = "config()")] | 27 | #[embassy_executor::main(config = "config()")] |
| 28 | async fn main(_spawner: Spawner, p: Peripherals) { | 28 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 29 | info!("Hello World!"); | 29 | info!("Hello World!"); |
| 30 | 30 | ||
diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml index 22e2e09a1..4ce95be4c 100644 --- a/examples/stm32u5/Cargo.toml +++ b/examples/stm32u5/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32u5-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } |
| 9 | 10 | ||
| 10 | defmt = "0.3" | 11 | defmt = "0.3" |
diff --git a/examples/stm32u5/src/bin/blinky.rs b/examples/stm32u5/src/bin/blinky.rs index 4910e0b98..4f3eabc5e 100644 --- a/examples/stm32u5/src/bin/blinky.rs +++ b/examples/stm32u5/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { | 13 | async fn main(_spawner: Spawner, p: Peripherals) -> ! { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index 812d638fa..dc9107dd0 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32wb-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55cc", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55cc", "time-driver-any", "exti"] } |
| 9 | 10 | ||
| 10 | defmt = "0.3" | 11 | defmt = "0.3" |
diff --git a/examples/stm32wb/src/bin/blinky.rs b/examples/stm32wb/src/bin/blinky.rs index 8ab9b749d..3d8e8391d 100644 --- a/examples/stm32wb/src/bin/blinky.rs +++ b/examples/stm32wb/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32wb/src/bin/button_exti.rs b/examples/stm32wb/src/bin/button_exti.rs index 2ddeb887c..41afaf4d6 100644 --- a/examples/stm32wb/src/bin/button_exti.rs +++ b/examples/stm32wb/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml index 6be360735..00d63f02d 100644 --- a/examples/stm32wl/Cargo.toml +++ b/examples/stm32wl/Cargo.toml | |||
| @@ -4,7 +4,8 @@ name = "embassy-stm32wl-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } | ||
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "subghz", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "subghz", "unstable-pac", "exti"] } |
| 9 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time", "defmt"] } | 10 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time", "defmt"] } |
| 10 | 11 | ||
diff --git a/examples/stm32wl/src/bin/blinky.rs b/examples/stm32wl/src/bin/blinky.rs index 9393af1c6..e764b4cc3 100644 --- a/examples/stm32wl/src/bin/blinky.rs +++ b/examples/stm32wl/src/bin/blinky.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32wl/src/bin/button_exti.rs b/examples/stm32wl/src/bin/button_exti.rs index 7d5c1b3cb..9f143597d 100644 --- a/examples/stm32wl/src/bin/button_exti.rs +++ b/examples/stm32wl/src/bin/button_exti.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 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_stm32::exti::ExtiInput; | 7 | use embassy_stm32::exti::ExtiInput; |
| 8 | use embassy_stm32::gpio::{Input, Pull}; | 8 | use embassy_stm32::gpio::{Input, Pull}; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello World!"); | 14 | info!("Hello World!"); |
| 15 | 15 | ||
diff --git a/examples/stm32wl/src/bin/flash.rs b/examples/stm32wl/src/bin/flash.rs index 6531feae9..46183b8a2 100644 --- a/examples/stm32wl/src/bin/flash.rs +++ b/examples/stm32wl/src/bin/flash.rs | |||
| @@ -3,13 +3,13 @@ | |||
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_stm32::flash::Flash; | 7 | use embassy_stm32::flash::Flash; |
| 8 | use embassy_stm32::Peripherals; | 8 | use embassy_stm32::Peripherals; |
| 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | 9 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | #[embassy::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner, p: Peripherals) { | 13 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 14 | info!("Hello Flash!"); | 14 | info!("Hello Flash!"); |
| 15 | 15 | ||
diff --git a/examples/stm32wl/src/bin/lorawan.rs b/examples/stm32wl/src/bin/lorawan.rs index 158c17e18..2db022ea2 100644 --- a/examples/stm32wl/src/bin/lorawan.rs +++ b/examples/stm32wl/src/bin/lorawan.rs | |||
| @@ -23,8 +23,8 @@ fn config() -> embassy_stm32::Config { | |||
| 23 | config | 23 | config |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | #[embassy::main(config = "config()")] | 26 | #[embassy_executor::main(config = "config()")] |
| 27 | async fn main(_spawner: embassy::executor::Spawner, p: Peripherals) { | 27 | async fn main(_spawner: embassy_executor::executor::Spawner, p: Peripherals) { |
| 28 | unsafe { pac::RCC.ccipr().modify(|w| w.set_rngsel(0b01)) } | 28 | unsafe { pac::RCC.ccipr().modify(|w| w.set_rngsel(0b01)) } |
| 29 | 29 | ||
| 30 | let ctrl1 = Output::new(p.PC3.degrade(), Level::High, Speed::High); | 30 | let ctrl1 = Output::new(p.PC3.degrade(), Level::High, Speed::High); |
diff --git a/examples/stm32wl/src/bin/subghz.rs b/examples/stm32wl/src/bin/subghz.rs index c5f6e502a..775dfbbfc 100644 --- a/examples/stm32wl/src/bin/subghz.rs +++ b/examples/stm32wl/src/bin/subghz.rs | |||
| @@ -6,13 +6,13 @@ | |||
| 6 | #![feature(type_alias_impl_trait)] | 6 | #![feature(type_alias_impl_trait)] |
| 7 | 7 | ||
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy::channel::signal::Signal; | ||
| 10 | use embassy_stm32::dma::NoDma; | 9 | use embassy_stm32::dma::NoDma; |
| 11 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 11 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; |
| 13 | use embassy_stm32::interrupt::{Interrupt, InterruptExt}; | 12 | use embassy_stm32::interrupt::{Interrupt, InterruptExt}; |
| 14 | use embassy_stm32::subghz::*; | 13 | use embassy_stm32::subghz::*; |
| 15 | use embassy_stm32::{interrupt, Peripherals}; | 14 | use embassy_stm32::{interrupt, Peripherals}; |
| 15 | use embassy_util::channel::signal::Signal; | ||
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | const PING_DATA: &str = "PING"; | 18 | const PING_DATA: &str = "PING"; |
| @@ -57,8 +57,8 @@ fn config() -> embassy_stm32::Config { | |||
| 57 | config | 57 | config |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | #[embassy::main(config = "config()")] | 60 | #[embassy_executor::main(config = "config()")] |
| 61 | async fn main(_spawner: embassy::executor::Spawner, p: Peripherals) { | 61 | async fn main(_spawner: embassy_executor::executor::Spawner, p: Peripherals) { |
| 62 | let mut led1 = Output::new(p.PB15, Level::High, Speed::Low); | 62 | let mut led1 = Output::new(p.PB15, Level::High, Speed::Low); |
| 63 | let mut led2 = Output::new(p.PB9, Level::Low, Speed::Low); | 63 | let mut led2 = Output::new(p.PB9, Level::Low, Speed::Low); |
| 64 | let mut led3 = Output::new(p.PB11, Level::Low, Speed::Low); | 64 | let mut led3 = Output::new(p.PB11, Level::Low, Speed::Low); |
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index 347252fa3..4e26f023c 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml | |||
| @@ -7,7 +7,8 @@ version = "0.1.0" | |||
| 7 | crate-type = ["cdylib"] | 7 | crate-type = ["cdylib"] |
| 8 | 8 | ||
| 9 | [dependencies] | 9 | [dependencies] |
| 10 | embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "wasm", "nightly"] } | 10 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["log"] } |
| 11 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "wasm", "nightly"] } | ||
| 11 | 12 | ||
| 12 | wasm-logger = "0.2.0" | 13 | wasm-logger = "0.2.0" |
| 13 | wasm-bindgen = "0.2" | 14 | wasm-bindgen = "0.2" |
diff --git a/examples/wasm/src/lib.rs b/examples/wasm/src/lib.rs index 61757ebd7..2e961e65a 100644 --- a/examples/wasm/src/lib.rs +++ b/examples/wasm/src/lib.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | 1 | #![feature(type_alias_impl_trait)] |
| 2 | #![allow(incomplete_features)] | 2 | #![allow(incomplete_features)] |
| 3 | 3 | ||
| 4 | use embassy::executor::Spawner; | 4 | use embassy_executor::executor::Spawner; |
| 5 | use embassy::time::{Duration, Timer}; | 5 | use embassy_executor::time::{Duration, Timer}; |
| 6 | 6 | ||
| 7 | #[embassy::task] | 7 | #[embassy_executor::task] |
| 8 | async fn ticker() { | 8 | async fn ticker() { |
| 9 | let window = web_sys::window().expect("no global `window` exists"); | 9 | let window = web_sys::window().expect("no global `window` exists"); |
| 10 | 10 | ||
| @@ -24,7 +24,7 @@ async fn ticker() { | |||
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy::main] | 27 | #[embassy_executor::main] |
| 28 | async fn main(spawner: Spawner) { | 28 | async fn main(spawner: Spawner) { |
| 29 | wasm_logger::init(wasm_logger::Config::default()); | 29 | wasm_logger::init(wasm_logger::Config::default()); |
| 30 | spawner.spawn(ticker()).unwrap(); | 30 | spawner.spawn(ticker()).unwrap(); |
