diff options
Diffstat (limited to 'examples')
336 files changed, 327 insertions, 540 deletions
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml index 5f11750b2..b52bac650 100644 --- a/examples/boot/application/nrf/Cargo.toml +++ b/examples/boot/application/nrf/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers", "arch-cortex-m", "executor-thread"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [] } |
| 11 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", ] } | 11 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", ] } |
| 12 | embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = [] } | 12 | embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = [] } |
diff --git a/examples/boot/application/nrf/src/bin/a.rs b/examples/boot/application/nrf/src/bin/a.rs index 8b510ed35..f3abfddbc 100644 --- a/examples/boot/application/nrf/src/bin/a.rs +++ b/examples/boot/application/nrf/src/bin/a.rs | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | #![feature(type_alias_impl_trait)] | ||
| 5 | 4 | ||
| 6 | use embassy_boot_nrf::{FirmwareUpdater, FirmwareUpdaterConfig}; | 5 | use embassy_boot_nrf::{FirmwareUpdater, FirmwareUpdaterConfig}; |
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 6 | use embassy_embedded_hal::adapter::BlockingAsync; |
diff --git a/examples/boot/application/nrf/src/bin/b.rs b/examples/boot/application/nrf/src/bin/b.rs index a88c3c56c..de97b6a22 100644 --- a/examples/boot/application/nrf/src/bin/b.rs +++ b/examples/boot/application/nrf/src/bin/b.rs | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | #![feature(type_alias_impl_trait)] | ||
| 5 | 4 | ||
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 6 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
diff --git a/examples/boot/application/rp/Cargo.toml b/examples/boot/application/rp/Cargo.toml index 89ac5a8f6..08ce16877 100644 --- a/examples/boot/application/rp/Cargo.toml +++ b/examples/boot/application/rp/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers", "arch-cortex-m", "executor-thread"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [] } |
| 11 | embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", ] } | 11 | embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", ] } |
| 12 | embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = [] } | 12 | embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = [] } |
diff --git a/examples/boot/application/rp/src/bin/a.rs b/examples/boot/application/rp/src/bin/a.rs index 6fd5d7f60..3f0bf90e2 100644 --- a/examples/boot/application/rp/src/bin/a.rs +++ b/examples/boot/application/rp/src/bin/a.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::cell::RefCell; | 4 | use core::cell::RefCell; |
| 6 | 5 | ||
diff --git a/examples/boot/application/rp/src/bin/b.rs b/examples/boot/application/rp/src/bin/b.rs index 1eca5b4a2..a46d095bf 100644 --- a/examples/boot/application/rp/src/bin/b.rs +++ b/examples/boot/application/rp/src/bin/b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 6 | use embassy_rp::gpio; | 5 | use embassy_rp::gpio; |
diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml index 1a0f8cee5..248ec6dce 100644 --- a/examples/boot/application/stm32f3/Cargo.toml +++ b/examples/boot/application/stm32f3/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f303re", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f303re", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } |
diff --git a/examples/boot/application/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs index 8be39bfb7..96ae5c47b 100644 --- a/examples/boot/application/stm32f3/src/bin/a.rs +++ b/examples/boot/application/stm32f3/src/bin/a.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32f3/src/bin/b.rs b/examples/boot/application/stm32f3/src/bin/b.rs index 8411f384c..22ba82d5e 100644 --- a/examples/boot/application/stm32f3/src/bin/b.rs +++ b/examples/boot/application/stm32f3/src/bin/b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml index e42d1d421..aa5f87615 100644 --- a/examples/boot/application/stm32f7/Cargo.toml +++ b/examples/boot/application/stm32f7/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f767zi", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f767zi", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
diff --git a/examples/boot/application/stm32f7/src/bin/a.rs b/examples/boot/application/stm32f7/src/bin/a.rs index 0c3819bed..a6107386a 100644 --- a/examples/boot/application/stm32f7/src/bin/a.rs +++ b/examples/boot/application/stm32f7/src/bin/a.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::cell::RefCell; | 4 | use core::cell::RefCell; |
| 6 | 5 | ||
diff --git a/examples/boot/application/stm32f7/src/bin/b.rs b/examples/boot/application/stm32f7/src/bin/b.rs index 4c2ad06a2..190477204 100644 --- a/examples/boot/application/stm32f7/src/bin/b.rs +++ b/examples/boot/application/stm32f7/src/bin/b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml index 8450d8639..78e33de28 100644 --- a/examples/boot/application/stm32h7/Cargo.toml +++ b/examples/boot/application/stm32h7/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32h743zi", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32h743zi", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
diff --git a/examples/boot/application/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs index f239e3732..b73506cf3 100644 --- a/examples/boot/application/stm32h7/src/bin/a.rs +++ b/examples/boot/application/stm32h7/src/bin/a.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::cell::RefCell; | 4 | use core::cell::RefCell; |
| 6 | 5 | ||
diff --git a/examples/boot/application/stm32h7/src/bin/b.rs b/examples/boot/application/stm32h7/src/bin/b.rs index 5c03e2d0c..5f3f35207 100644 --- a/examples/boot/application/stm32h7/src/bin/b.rs +++ b/examples/boot/application/stm32h7/src/bin/b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml index d6684bedb..240afe4c6 100644 --- a/examples/boot/application/stm32l0/Cargo.toml +++ b/examples/boot/application/stm32l0/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l072cz", "time-driver-any", "exti", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l072cz", "time-driver-any", "exti", "memory-x"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
diff --git a/examples/boot/application/stm32l0/src/bin/a.rs b/examples/boot/application/stm32l0/src/bin/a.rs index 42e1a71eb..02f74bdef 100644 --- a/examples/boot/application/stm32l0/src/bin/a.rs +++ b/examples/boot/application/stm32l0/src/bin/a.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32l0/src/bin/b.rs b/examples/boot/application/stm32l0/src/bin/b.rs index 52d42395f..6bf00f41a 100644 --- a/examples/boot/application/stm32l0/src/bin/b.rs +++ b/examples/boot/application/stm32l0/src/bin/b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml index cca8bf443..97f1e277b 100644 --- a/examples/boot/application/stm32l1/Cargo.toml +++ b/examples/boot/application/stm32l1/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l151cb-a", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l151cb-a", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
diff --git a/examples/boot/application/stm32l1/src/bin/a.rs b/examples/boot/application/stm32l1/src/bin/a.rs index 42e1a71eb..02f74bdef 100644 --- a/examples/boot/application/stm32l1/src/bin/a.rs +++ b/examples/boot/application/stm32l1/src/bin/a.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32l1/src/bin/b.rs b/examples/boot/application/stm32l1/src/bin/b.rs index 52d42395f..6bf00f41a 100644 --- a/examples/boot/application/stm32l1/src/bin/b.rs +++ b/examples/boot/application/stm32l1/src/bin/b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml index 30d61056c..0c3830f97 100644 --- a/examples/boot/application/stm32l4/Cargo.toml +++ b/examples/boot/application/stm32l4/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs index eefa25f75..892446968 100644 --- a/examples/boot/application/stm32l4/src/bin/a.rs +++ b/examples/boot/application/stm32l4/src/bin/a.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32l4/src/bin/b.rs b/examples/boot/application/stm32l4/src/bin/b.rs index 8411f384c..22ba82d5e 100644 --- a/examples/boot/application/stm32l4/src/bin/b.rs +++ b/examples/boot/application/stm32l4/src/bin/b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32wb-dfu/Cargo.toml b/examples/boot/application/stm32wb-dfu/Cargo.toml index f6beea498..cdaee802e 100644 --- a/examples/boot/application/stm32wb-dfu/Cargo.toml +++ b/examples/boot/application/stm32wb-dfu/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32wb55rg", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32wb55rg", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
diff --git a/examples/boot/application/stm32wb-dfu/src/main.rs b/examples/boot/application/stm32wb-dfu/src/main.rs index fbecbf23b..b2ccb9e1a 100644 --- a/examples/boot/application/stm32wb-dfu/src/main.rs +++ b/examples/boot/application/stm32wb-dfu/src/main.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::cell::RefCell; | 4 | use core::cell::RefCell; |
| 6 | 5 | ||
diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml index 7489a2fe9..b5677e148 100644 --- a/examples/boot/application/stm32wl/Cargo.toml +++ b/examples/boot/application/stm32wl/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32wl55jc-cm4", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32wl55jc-cm4", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } |
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs index c837e47b5..d9665e6ee 100644 --- a/examples/boot/application/stm32wl/src/bin/a.rs +++ b/examples/boot/application/stm32wl/src/bin/a.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/boot/application/stm32wl/src/bin/b.rs b/examples/boot/application/stm32wl/src/bin/b.rs index 1ca3c6ea8..8dd15d8cd 100644 --- a/examples/boot/application/stm32wl/src/bin/b.rs +++ b/examples/boot/application/stm32wl/src/bin/b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt-rtt")] |
| 6 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
diff --git a/examples/nrf-rtos-trace/src/bin/rtos_trace.rs b/examples/nrf-rtos-trace/src/bin/rtos_trace.rs index 888375693..41cc06417 100644 --- a/examples/nrf-rtos-trace/src/bin/rtos_trace.rs +++ b/examples/nrf-rtos-trace/src/bin/rtos_trace.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::future::poll_fn; | 4 | use core::future::poll_fn; |
| 6 | use core::task::Poll; | 5 | use core::task::Poll; |
diff --git a/examples/nrf52840/Cargo.toml b/examples/nrf52840/Cargo.toml index 1c49c32e1..bc8a7f2d6 100644 --- a/examples/nrf52840/Cargo.toml +++ b/examples/nrf52840/Cargo.toml | |||
| @@ -4,12 +4,6 @@ name = "embassy-nrf52840-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | 6 | ||
| 7 | [features] | ||
| 8 | default = ["nightly"] | ||
| 9 | nightly = [ | ||
| 10 | "static_cell/nightly", | ||
| 11 | ] | ||
| 12 | |||
| 13 | [dependencies] | 7 | [dependencies] |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 8 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 15 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 9 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
diff --git a/examples/nrf52840/src/bin/blinky.rs b/examples/nrf52840/src/bin/blinky.rs index d3d1a7122..58a3d2cd9 100644 --- a/examples/nrf52840/src/bin/blinky.rs +++ b/examples/nrf52840/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 6 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 5 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
diff --git a/examples/nrf52840/src/bin/buffered_uart.rs b/examples/nrf52840/src/bin/buffered_uart.rs index d9c505786..6ac72bcaf 100644 --- a/examples/nrf52840/src/bin/buffered_uart.rs +++ b/examples/nrf52840/src/bin/buffered_uart.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/channel.rs b/examples/nrf52840/src/bin/channel.rs index d3c7b47d2..7fcea9dbd 100644 --- a/examples/nrf52840/src/bin/channel.rs +++ b/examples/nrf52840/src/bin/channel.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::unwrap; | 4 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/channel_sender_receiver.rs b/examples/nrf52840/src/bin/channel_sender_receiver.rs index 79d2c4048..3095a04ec 100644 --- a/examples/nrf52840/src/bin/channel_sender_receiver.rs +++ b/examples/nrf52840/src/bin/channel_sender_receiver.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::unwrap; | 4 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/ethernet_enc28j60.rs b/examples/nrf52840/src/bin/ethernet_enc28j60.rs index d1b796fab..a8e64b38a 100644 --- a/examples/nrf52840/src/bin/ethernet_enc28j60.rs +++ b/examples/nrf52840/src/bin/ethernet_enc28j60.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -14,7 +13,7 @@ use embassy_nrf::{bind_interrupts, peripherals, spim}; | |||
| 14 | use embassy_time::Delay; | 13 | use embassy_time::Delay; |
| 15 | use embedded_hal_bus::spi::ExclusiveDevice; | 14 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 16 | use embedded_io_async::Write; | 15 | use embedded_io_async::Write; |
| 17 | use static_cell::make_static; | 16 | use static_cell::StaticCell; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | 18 | ||
| 20 | bind_interrupts!(struct Irqs { | 19 | bind_interrupts!(struct Irqs { |
| @@ -70,11 +69,20 @@ async fn main(spawner: Spawner) { | |||
| 70 | let seed = u64::from_le_bytes(seed); | 69 | let seed = u64::from_le_bytes(seed); |
| 71 | 70 | ||
| 72 | // Init network stack | 71 | // Init network stack |
| 73 | let stack = &*make_static!(Stack::new( | 72 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); |
| 73 | static STACK: StaticCell< | ||
| 74 | Stack< | ||
| 75 | Enc28j60< | ||
| 76 | ExclusiveDevice<Spim<'static, peripherals::SPI3>, Output<'static, peripherals::P0_15>, Delay>, | ||
| 77 | Output<'static, peripherals::P0_13>, | ||
| 78 | >, | ||
| 79 | >, | ||
| 80 | > = StaticCell::new(); | ||
| 81 | let stack = STACK.init(Stack::new( | ||
| 74 | device, | 82 | device, |
| 75 | config, | 83 | config, |
| 76 | make_static!(StackResources::<2>::new()), | 84 | RESOURCES.init(StackResources::<2>::new()), |
| 77 | seed | 85 | seed, |
| 78 | )); | 86 | )); |
| 79 | 87 | ||
| 80 | unwrap!(spawner.spawn(net_task(stack))); | 88 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/nrf52840/src/bin/executor_fairness_test.rs b/examples/nrf52840/src/bin/executor_fairness_test.rs index f111b272e..df6e7af3f 100644 --- a/examples/nrf52840/src/bin/executor_fairness_test.rs +++ b/examples/nrf52840/src/bin/executor_fairness_test.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::future::poll_fn; | 4 | use core::future::poll_fn; |
| 6 | use core::task::Poll; | 5 | use core::task::Poll; |
diff --git a/examples/nrf52840/src/bin/gpiote_channel.rs b/examples/nrf52840/src/bin/gpiote_channel.rs index 5bfd02465..e254d613d 100644 --- a/examples/nrf52840/src/bin/gpiote_channel.rs +++ b/examples/nrf52840/src/bin/gpiote_channel.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/gpiote_port.rs b/examples/nrf52840/src/bin/gpiote_port.rs index 0155d539e..c1afe2f20 100644 --- a/examples/nrf52840/src/bin/gpiote_port.rs +++ b/examples/nrf52840/src/bin/gpiote_port.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/i2s_effect.rs b/examples/nrf52840/src/bin/i2s_effect.rs index 391514d93..9eadeb4e4 100644 --- a/examples/nrf52840/src/bin/i2s_effect.rs +++ b/examples/nrf52840/src/bin/i2s_effect.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::f32::consts::PI; | 4 | use core::f32::consts::PI; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/i2s_monitor.rs b/examples/nrf52840/src/bin/i2s_monitor.rs index 4ed597c0d..799be351f 100644 --- a/examples/nrf52840/src/bin/i2s_monitor.rs +++ b/examples/nrf52840/src/bin/i2s_monitor.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{debug, error, info}; | 4 | use defmt::{debug, error, info}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/i2s_waveform.rs b/examples/nrf52840/src/bin/i2s_waveform.rs index f2c1166b1..137d82840 100644 --- a/examples/nrf52840/src/bin/i2s_waveform.rs +++ b/examples/nrf52840/src/bin/i2s_waveform.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::f32::consts::PI; | 4 | use core::f32::consts::PI; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/manually_create_executor.rs b/examples/nrf52840/src/bin/manually_create_executor.rs index 80364d34a..7ca39348e 100644 --- a/examples/nrf52840/src/bin/manually_create_executor.rs +++ b/examples/nrf52840/src/bin/manually_create_executor.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | 6 | ||
| 8 | use cortex_m_rt::entry; | 7 | use cortex_m_rt::entry; |
| 9 | use defmt::{info, unwrap}; | 8 | use defmt::{info, unwrap}; |
diff --git a/examples/nrf52840/src/bin/multiprio.rs b/examples/nrf52840/src/bin/multiprio.rs index 352f62bf2..b634d8569 100644 --- a/examples/nrf52840/src/bin/multiprio.rs +++ b/examples/nrf52840/src/bin/multiprio.rs | |||
| @@ -55,7 +55,6 @@ | |||
| 55 | 55 | ||
| 56 | #![no_std] | 56 | #![no_std] |
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | ||
| 59 | 58 | ||
| 60 | use cortex_m_rt::entry; | 59 | use cortex_m_rt::entry; |
| 61 | use defmt::{info, unwrap}; | 60 | use defmt::{info, unwrap}; |
diff --git a/examples/nrf52840/src/bin/mutex.rs b/examples/nrf52840/src/bin/mutex.rs index 11b47d991..5c22279b5 100644 --- a/examples/nrf52840/src/bin/mutex.rs +++ b/examples/nrf52840/src/bin/mutex.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/nvmc.rs b/examples/nrf52840/src/bin/nvmc.rs index 624829863..a79385b98 100644 --- a/examples/nrf52840/src/bin/nvmc.rs +++ b/examples/nrf52840/src/bin/nvmc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/pdm.rs b/examples/nrf52840/src/bin/pdm.rs index bff323974..52dadc805 100644 --- a/examples/nrf52840/src/bin/pdm.rs +++ b/examples/nrf52840/src/bin/pdm.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/pdm_continuous.rs b/examples/nrf52840/src/bin/pdm_continuous.rs index 7d8531475..e948203a5 100644 --- a/examples/nrf52840/src/bin/pdm_continuous.rs +++ b/examples/nrf52840/src/bin/pdm_continuous.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::cmp::Ordering; | 4 | use core::cmp::Ordering; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/ppi.rs b/examples/nrf52840/src/bin/ppi.rs index d74ce4064..129ad06e7 100644 --- a/examples/nrf52840/src/bin/ppi.rs +++ b/examples/nrf52840/src/bin/ppi.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::future::pending; | 4 | use core::future::pending; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/pubsub.rs b/examples/nrf52840/src/bin/pubsub.rs index 17d902227..5ebea9220 100644 --- a/examples/nrf52840/src/bin/pubsub.rs +++ b/examples/nrf52840/src/bin/pubsub.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::unwrap; | 4 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/pwm.rs b/examples/nrf52840/src/bin/pwm.rs index 9750935c8..a5bb1347a 100644 --- a/examples/nrf52840/src/bin/pwm.rs +++ b/examples/nrf52840/src/bin/pwm.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/pwm_double_sequence.rs b/examples/nrf52840/src/bin/pwm_double_sequence.rs index 1bfe6e15a..386c483b8 100644 --- a/examples/nrf52840/src/bin/pwm_double_sequence.rs +++ b/examples/nrf52840/src/bin/pwm_double_sequence.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/pwm_sequence.rs b/examples/nrf52840/src/bin/pwm_sequence.rs index f282cf910..87eda265f 100644 --- a/examples/nrf52840/src/bin/pwm_sequence.rs +++ b/examples/nrf52840/src/bin/pwm_sequence.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/pwm_sequence_ppi.rs b/examples/nrf52840/src/bin/pwm_sequence_ppi.rs index 6594fa348..60ea712b5 100644 --- a/examples/nrf52840/src/bin/pwm_sequence_ppi.rs +++ b/examples/nrf52840/src/bin/pwm_sequence_ppi.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::future::pending; | 4 | use core::future::pending; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs b/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs index 8596e6545..751cf4425 100644 --- a/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs +++ b/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/pwm_servo.rs b/examples/nrf52840/src/bin/pwm_servo.rs index 92ded1f88..d772d2f5d 100644 --- a/examples/nrf52840/src/bin/pwm_servo.rs +++ b/examples/nrf52840/src/bin/pwm_servo.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/qdec.rs b/examples/nrf52840/src/bin/qdec.rs index 59783d312..ea849be63 100644 --- a/examples/nrf52840/src/bin/qdec.rs +++ b/examples/nrf52840/src/bin/qdec.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/qspi.rs b/examples/nrf52840/src/bin/qspi.rs index 9e8a01f4e..4539dd0e3 100644 --- a/examples/nrf52840/src/bin/qspi.rs +++ b/examples/nrf52840/src/bin/qspi.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{assert_eq, info, unwrap}; | 4 | use defmt::{assert_eq, info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/qspi_lowpower.rs b/examples/nrf52840/src/bin/qspi_lowpower.rs index 42b5454e0..516c9b481 100644 --- a/examples/nrf52840/src/bin/qspi_lowpower.rs +++ b/examples/nrf52840/src/bin/qspi_lowpower.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::mem; | 4 | use core::mem; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/rng.rs b/examples/nrf52840/src/bin/rng.rs index 855743f50..326054c9a 100644 --- a/examples/nrf52840/src/bin/rng.rs +++ b/examples/nrf52840/src/bin/rng.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 6 | use embassy_nrf::rng::Rng; | 5 | use embassy_nrf::rng::Rng; |
diff --git a/examples/nrf52840/src/bin/saadc.rs b/examples/nrf52840/src/bin/saadc.rs index d651834f5..653b7d606 100644 --- a/examples/nrf52840/src/bin/saadc.rs +++ b/examples/nrf52840/src/bin/saadc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/saadc_continuous.rs b/examples/nrf52840/src/bin/saadc_continuous.rs index a5f8a4dd7..f76fa3570 100644 --- a/examples/nrf52840/src/bin/saadc_continuous.rs +++ b/examples/nrf52840/src/bin/saadc_continuous.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/self_spawn.rs b/examples/nrf52840/src/bin/self_spawn.rs index 8a58396a4..5bfefc2af 100644 --- a/examples/nrf52840/src/bin/self_spawn.rs +++ b/examples/nrf52840/src/bin/self_spawn.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/self_spawn_current_executor.rs b/examples/nrf52840/src/bin/self_spawn_current_executor.rs index 65d50f8c3..ec9569a64 100644 --- a/examples/nrf52840/src/bin/self_spawn_current_executor.rs +++ b/examples/nrf52840/src/bin/self_spawn_current_executor.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/spim.rs b/examples/nrf52840/src/bin/spim.rs index 9d1843a8f..131187660 100644 --- a/examples/nrf52840/src/bin/spim.rs +++ b/examples/nrf52840/src/bin/spim.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/spis.rs b/examples/nrf52840/src/bin/spis.rs index 77b6e8b64..613cd37ab 100644 --- a/examples/nrf52840/src/bin/spis.rs +++ b/examples/nrf52840/src/bin/spis.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/temp.rs b/examples/nrf52840/src/bin/temp.rs index d94dea38d..1d28f8ecf 100644 --- a/examples/nrf52840/src/bin/temp.rs +++ b/examples/nrf52840/src/bin/temp.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/timer.rs b/examples/nrf52840/src/bin/timer.rs index 9b9bb3eb4..365695a20 100644 --- a/examples/nrf52840/src/bin/timer.rs +++ b/examples/nrf52840/src/bin/timer.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/twim.rs b/examples/nrf52840/src/bin/twim.rs index 959e3a4be..a9a0765e8 100644 --- a/examples/nrf52840/src/bin/twim.rs +++ b/examples/nrf52840/src/bin/twim.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/twim_lowpower.rs b/examples/nrf52840/src/bin/twim_lowpower.rs index bf9f966ef..c743614b8 100644 --- a/examples/nrf52840/src/bin/twim_lowpower.rs +++ b/examples/nrf52840/src/bin/twim_lowpower.rs | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #![no_std] | 7 | #![no_std] |
| 8 | #![no_main] | 8 | #![no_main] |
| 9 | #![feature(type_alias_impl_trait)] | ||
| 10 | 9 | ||
| 11 | use core::mem; | 10 | use core::mem; |
| 12 | 11 | ||
diff --git a/examples/nrf52840/src/bin/twis.rs b/examples/nrf52840/src/bin/twis.rs index aa42b679e..88bd4cceb 100644 --- a/examples/nrf52840/src/bin/twis.rs +++ b/examples/nrf52840/src/bin/twis.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | 5 | ||
| 7 | use defmt::*; | 6 | use defmt::*; |
| 8 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/uart.rs b/examples/nrf52840/src/bin/uart.rs index 50d5cab8c..accaccea1 100644 --- a/examples/nrf52840/src/bin/uart.rs +++ b/examples/nrf52840/src/bin/uart.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/uart_idle.rs b/examples/nrf52840/src/bin/uart_idle.rs index e1f42fa6c..fa93bcf21 100644 --- a/examples/nrf52840/src/bin/uart_idle.rs +++ b/examples/nrf52840/src/bin/uart_idle.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/uart_split.rs b/examples/nrf52840/src/bin/uart_split.rs index b748bfcd8..c7510a9a8 100644 --- a/examples/nrf52840/src/bin/uart_split.rs +++ b/examples/nrf52840/src/bin/uart_split.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs index b7806f418..3469c6e5f 100644 --- a/examples/nrf52840/src/bin/usb_ethernet.rs +++ b/examples/nrf52840/src/bin/usb_ethernet.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::mem; | 4 | use core::mem; |
| 6 | 5 | ||
| @@ -16,7 +15,7 @@ use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState | |||
| 16 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; | 15 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; |
| 17 | use embassy_usb::{Builder, Config, UsbDevice}; | 16 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 18 | use embedded_io_async::Write; | 17 | use embedded_io_async::Write; |
| 19 | use static_cell::make_static; | 18 | use static_cell::StaticCell; |
| 20 | use {defmt_rtt as _, panic_probe as _}; | 19 | use {defmt_rtt as _, panic_probe as _}; |
| 21 | 20 | ||
| 22 | bind_interrupts!(struct Irqs { | 21 | bind_interrupts!(struct Irqs { |
| @@ -71,14 +70,19 @@ async fn main(spawner: Spawner) { | |||
| 71 | config.device_protocol = 0x01; | 70 | config.device_protocol = 0x01; |
| 72 | 71 | ||
| 73 | // Create embassy-usb DeviceBuilder using the driver and config. | 72 | // Create embassy-usb DeviceBuilder using the driver and config. |
| 73 | static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 74 | static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 75 | static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 76 | static MSOS_DESC: StaticCell<[u8; 128]> = StaticCell::new(); | ||
| 77 | static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new(); | ||
| 74 | let mut builder = Builder::new( | 78 | let mut builder = Builder::new( |
| 75 | driver, | 79 | driver, |
| 76 | config, | 80 | config, |
| 77 | &mut make_static!([0; 256])[..], | 81 | &mut DEVICE_DESC.init([0; 256])[..], |
| 78 | &mut make_static!([0; 256])[..], | 82 | &mut CONFIG_DESC.init([0; 256])[..], |
| 79 | &mut make_static!([0; 256])[..], | 83 | &mut BOS_DESC.init([0; 256])[..], |
| 80 | &mut make_static!([0; 128])[..], | 84 | &mut MSOS_DESC.init([0; 128])[..], |
| 81 | &mut make_static!([0; 128])[..], | 85 | &mut CONTROL_BUF.init([0; 128])[..], |
| 82 | ); | 86 | ); |
| 83 | 87 | ||
| 84 | // Our MAC addr. | 88 | // Our MAC addr. |
| @@ -87,14 +91,16 @@ async fn main(spawner: Spawner) { | |||
| 87 | let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; | 91 | let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; |
| 88 | 92 | ||
| 89 | // Create classes on the builder. | 93 | // Create classes on the builder. |
| 90 | let class = CdcNcmClass::new(&mut builder, make_static!(State::new()), host_mac_addr, 64); | 94 | static STATE: StaticCell<State> = StaticCell::new(); |
| 95 | let class = CdcNcmClass::new(&mut builder, STATE.init(State::new()), host_mac_addr, 64); | ||
| 91 | 96 | ||
| 92 | // Build the builder. | 97 | // Build the builder. |
| 93 | let usb = builder.build(); | 98 | let usb = builder.build(); |
| 94 | 99 | ||
| 95 | unwrap!(spawner.spawn(usb_task(usb))); | 100 | unwrap!(spawner.spawn(usb_task(usb))); |
| 96 | 101 | ||
| 97 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); | 102 | static NET_STATE: StaticCell<NetState<MTU, 4, 4>> = StaticCell::new(); |
| 103 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(NET_STATE.init(NetState::new()), our_mac_addr); | ||
| 98 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 104 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 99 | 105 | ||
| 100 | let config = embassy_net::Config::dhcpv4(Default::default()); | 106 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| @@ -111,12 +117,9 @@ async fn main(spawner: Spawner) { | |||
| 111 | let seed = u64::from_le_bytes(seed); | 117 | let seed = u64::from_le_bytes(seed); |
| 112 | 118 | ||
| 113 | // Init network stack | 119 | // Init network stack |
| 114 | let stack = &*make_static!(Stack::new( | 120 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); |
| 115 | device, | 121 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); |
| 116 | config, | 122 | let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed)); |
| 117 | make_static!(StackResources::<2>::new()), | ||
| 118 | seed | ||
| 119 | )); | ||
| 120 | 123 | ||
| 121 | unwrap!(spawner.spawn(net_task(stack))); | 124 | unwrap!(spawner.spawn(net_task(stack))); |
| 122 | 125 | ||
diff --git a/examples/nrf52840/src/bin/usb_hid_keyboard.rs b/examples/nrf52840/src/bin/usb_hid_keyboard.rs index 7ccd2946a..45850b4a4 100644 --- a/examples/nrf52840/src/bin/usb_hid_keyboard.rs +++ b/examples/nrf52840/src/bin/usb_hid_keyboard.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::mem; | 4 | use core::mem; |
| 6 | use core::sync::atomic::{AtomicBool, Ordering}; | 5 | use core::sync::atomic::{AtomicBool, Ordering}; |
diff --git a/examples/nrf52840/src/bin/usb_hid_mouse.rs b/examples/nrf52840/src/bin/usb_hid_mouse.rs index 96fcf8a66..04ad841b7 100644 --- a/examples/nrf52840/src/bin/usb_hid_mouse.rs +++ b/examples/nrf52840/src/bin/usb_hid_mouse.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::mem; | 4 | use core::mem; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/usb_serial.rs b/examples/nrf52840/src/bin/usb_serial.rs index dc95cde84..aff539b1b 100644 --- a/examples/nrf52840/src/bin/usb_serial.rs +++ b/examples/nrf52840/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::mem; | 4 | use core::mem; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/usb_serial_multitask.rs b/examples/nrf52840/src/bin/usb_serial_multitask.rs index cd4392903..4e8118fb8 100644 --- a/examples/nrf52840/src/bin/usb_serial_multitask.rs +++ b/examples/nrf52840/src/bin/usb_serial_multitask.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::mem; | 4 | use core::mem; |
| 6 | 5 | ||
| @@ -12,7 +11,7 @@ use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; | |||
| 12 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 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 static_cell::make_static; | 14 | use static_cell::StaticCell; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 16 | ||
| 18 | bind_interrupts!(struct Irqs { | 17 | bind_interrupts!(struct Irqs { |
| @@ -64,17 +63,23 @@ async fn main(spawner: Spawner) { | |||
| 64 | config.device_protocol = 0x01; | 63 | config.device_protocol = 0x01; |
| 65 | config.composite_with_iads = true; | 64 | config.composite_with_iads = true; |
| 66 | 65 | ||
| 67 | let state = make_static!(State::new()); | 66 | static STATE: StaticCell<State> = StaticCell::new(); |
| 67 | let state = STATE.init(State::new()); | ||
| 68 | 68 | ||
| 69 | // Create embassy-usb DeviceBuilder using the driver and config. | 69 | // Create embassy-usb DeviceBuilder using the driver and config. |
| 70 | static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 71 | static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 72 | static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 73 | static MSOS_DESC: StaticCell<[u8; 128]> = StaticCell::new(); | ||
| 74 | static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new(); | ||
| 70 | let mut builder = Builder::new( | 75 | let mut builder = Builder::new( |
| 71 | driver, | 76 | driver, |
| 72 | config, | 77 | config, |
| 73 | &mut make_static!([0; 256])[..], | 78 | &mut DEVICE_DESC.init([0; 256])[..], |
| 74 | &mut make_static!([0; 256])[..], | 79 | &mut CONFIG_DESC.init([0; 256])[..], |
| 75 | &mut make_static!([0; 256])[..], | 80 | &mut BOS_DESC.init([0; 256])[..], |
| 76 | &mut make_static!([0; 128])[..], | 81 | &mut MSOS_DESC.init([0; 128])[..], |
| 77 | &mut make_static!([0; 128])[..], | 82 | &mut CONTROL_BUF.init([0; 128])[..], |
| 78 | ); | 83 | ); |
| 79 | 84 | ||
| 80 | // Create classes on the builder. | 85 | // Create classes on the builder. |
diff --git a/examples/nrf52840/src/bin/usb_serial_winusb.rs b/examples/nrf52840/src/bin/usb_serial_winusb.rs index 1d39d3841..060f9ba94 100644 --- a/examples/nrf52840/src/bin/usb_serial_winusb.rs +++ b/examples/nrf52840/src/bin/usb_serial_winusb.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::mem; | 4 | use core::mem; |
| 6 | 5 | ||
diff --git a/examples/nrf52840/src/bin/wdt.rs b/examples/nrf52840/src/bin/wdt.rs index 058746518..ede88cc26 100644 --- a/examples/nrf52840/src/bin/wdt.rs +++ b/examples/nrf52840/src/bin/wdt.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf52840/src/bin/wifi_esp_hosted.rs b/examples/nrf52840/src/bin/wifi_esp_hosted.rs index a60822fd9..fc2086f75 100644 --- a/examples/nrf52840/src/bin/wifi_esp_hosted.rs +++ b/examples/nrf52840/src/bin/wifi_esp_hosted.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap, warn}; | 4 | use defmt::{info, unwrap, warn}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -13,7 +12,7 @@ use embassy_nrf::{bind_interrupts, peripherals}; | |||
| 13 | use embassy_time::Delay; | 12 | use embassy_time::Delay; |
| 14 | use embedded_hal_bus::spi::ExclusiveDevice; | 13 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 15 | use embedded_io_async::Write; | 14 | use embedded_io_async::Write; |
| 16 | use static_cell::make_static; | 15 | use static_cell::StaticCell; |
| 17 | use {defmt_rtt as _, embassy_net_esp_hosted as hosted, panic_probe as _}; | 16 | use {defmt_rtt as _, embassy_net_esp_hosted as hosted, panic_probe as _}; |
| 18 | 17 | ||
| 19 | const WIFI_NETWORK: &str = "EmbassyTest"; | 18 | const WIFI_NETWORK: &str = "EmbassyTest"; |
| @@ -61,8 +60,9 @@ async fn main(spawner: Spawner) { | |||
| 61 | let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config); | 60 | let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config); |
| 62 | let spi = ExclusiveDevice::new(spi, cs, Delay); | 61 | let spi = ExclusiveDevice::new(spi, cs, Delay); |
| 63 | 62 | ||
| 63 | static ESP_STATE: StaticCell<embassy_net_esp_hosted::State> = StaticCell::new(); | ||
| 64 | let (device, mut control, runner) = embassy_net_esp_hosted::new( | 64 | let (device, mut control, runner) = embassy_net_esp_hosted::new( |
| 65 | make_static!(embassy_net_esp_hosted::State::new()), | 65 | ESP_STATE.init(embassy_net_esp_hosted::State::new()), |
| 66 | spi, | 66 | spi, |
| 67 | handshake, | 67 | handshake, |
| 68 | ready, | 68 | ready, |
| @@ -89,11 +89,13 @@ async fn main(spawner: Spawner) { | |||
| 89 | let seed = u64::from_le_bytes(seed); | 89 | let seed = u64::from_le_bytes(seed); |
| 90 | 90 | ||
| 91 | // Init network stack | 91 | // Init network stack |
| 92 | let stack = &*make_static!(Stack::new( | 92 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); |
| 93 | static STACK: StaticCell<Stack<hosted::NetDriver<'static>>> = StaticCell::new(); | ||
| 94 | let stack = &*STACK.init(Stack::new( | ||
| 93 | device, | 95 | device, |
| 94 | config, | 96 | config, |
| 95 | make_static!(StackResources::<2>::new()), | 97 | RESOURCES.init(StackResources::<2>::new()), |
| 96 | seed | 98 | seed, |
| 97 | )); | 99 | )); |
| 98 | 100 | ||
| 99 | unwrap!(spawner.spawn(net_task(stack))); | 101 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/nrf5340/Cargo.toml b/examples/nrf5340/Cargo.toml index 17d3e30e4..fc0346f90 100644 --- a/examples/nrf5340/Cargo.toml +++ b/examples/nrf5340/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 8 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 9 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 9 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 10 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "defmt", "integrated-timers"] } | 10 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 11 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } | 11 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 12 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf5340-app-s", "time-driver-rtc1", "gpiote", "unstable-pac"] } | 12 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf5340-app-s", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
| 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } | 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } |
| @@ -17,7 +17,7 @@ embedded-io-async = { version = "0.6.1" } | |||
| 17 | defmt = "0.3" | 17 | defmt = "0.3" |
| 18 | defmt-rtt = "0.4" | 18 | defmt-rtt = "0.4" |
| 19 | 19 | ||
| 20 | static_cell = { version = "2", features = ["nightly"]} | 20 | static_cell = "2" |
| 21 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 21 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 22 | cortex-m-rt = "0.7.0" | 22 | cortex-m-rt = "0.7.0" |
| 23 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 23 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
diff --git a/examples/nrf5340/src/bin/blinky.rs b/examples/nrf5340/src/bin/blinky.rs index b784564a5..5c533c9b1 100644 --- a/examples/nrf5340/src/bin/blinky.rs +++ b/examples/nrf5340/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 6 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 5 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
diff --git a/examples/nrf5340/src/bin/gpiote_channel.rs b/examples/nrf5340/src/bin/gpiote_channel.rs index ceab1194a..c0a55142f 100644 --- a/examples/nrf5340/src/bin/gpiote_channel.rs +++ b/examples/nrf5340/src/bin/gpiote_channel.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/nrf5340/src/bin/uart.rs b/examples/nrf5340/src/bin/uart.rs index d68539702..7b41d7463 100644 --- a/examples/nrf5340/src/bin/uart.rs +++ b/examples/nrf5340/src/bin/uart.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index 521f17b82..07de83203 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } | 9 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl"] } | 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl"] } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| @@ -43,7 +43,7 @@ embedded-hal-async = "1.0.0-rc.3" | |||
| 43 | embedded-hal-bus = { version = "0.1.0-rc.3", features = ["async"] } | 43 | embedded-hal-bus = { version = "0.1.0-rc.3", features = ["async"] } |
| 44 | embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } | 44 | embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } |
| 45 | embedded-storage = { version = "0.3" } | 45 | embedded-storage = { version = "0.3" } |
| 46 | static_cell = { version = "2", features = ["nightly"]} | 46 | static_cell = "2" |
| 47 | portable-atomic = { version = "1.5", features = ["critical-section"] } | 47 | portable-atomic = { version = "1.5", features = ["critical-section"] } |
| 48 | log = "0.4" | 48 | log = "0.4" |
| 49 | pio-proc = "0.2" | 49 | pio-proc = "0.2" |
diff --git a/examples/rp/src/bin/adc.rs b/examples/rp/src/bin/adc.rs index a579be139..1bb7c2249 100644 --- a/examples/rp/src/bin/adc.rs +++ b/examples/rp/src/bin/adc.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | 6 | ||
| 8 | use defmt::*; | 7 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/blinky.rs b/examples/rp/src/bin/blinky.rs index 66c8773fa..60fc45a70 100644 --- a/examples/rp/src/bin/blinky.rs +++ b/examples/rp/src/bin/blinky.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/button.rs b/examples/rp/src/bin/button.rs index a9f34ab5d..e9054fd48 100644 --- a/examples/rp/src/bin/button.rs +++ b/examples/rp/src/bin/button.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::gpio::{Input, Level, Output, Pull}; | 9 | use embassy_rp::gpio::{Input, Level, Output, Pull}; |
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs index c0fde62ab..a16ea0007 100644 --- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs +++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| @@ -20,7 +19,7 @@ use embassy_time::{Delay, Duration}; | |||
| 20 | use embedded_hal_bus::spi::ExclusiveDevice; | 19 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 21 | use embedded_io_async::Write; | 20 | use embedded_io_async::Write; |
| 22 | use rand::RngCore; | 21 | use rand::RngCore; |
| 23 | use static_cell::make_static; | 22 | use static_cell::StaticCell; |
| 24 | use {defmt_rtt as _, panic_probe as _}; | 23 | use {defmt_rtt as _, panic_probe as _}; |
| 25 | 24 | ||
| 26 | #[embassy_executor::task] | 25 | #[embassy_executor::task] |
| @@ -55,7 +54,8 @@ async fn main(spawner: Spawner) { | |||
| 55 | let w5500_reset = Output::new(p.PIN_20, Level::High); | 54 | let w5500_reset = Output::new(p.PIN_20, Level::High); |
| 56 | 55 | ||
| 57 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 56 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 58 | let state = make_static!(State::<8, 8>::new()); | 57 | static STATE: StaticCell<State<8, 8>> = StaticCell::new(); |
| 58 | let state = STATE.init(State::<8, 8>::new()); | ||
| 59 | let (device, runner) = embassy_net_wiznet::new( | 59 | let (device, runner) = embassy_net_wiznet::new( |
| 60 | mac_addr, | 60 | mac_addr, |
| 61 | state, | 61 | state, |
| @@ -70,11 +70,13 @@ async fn main(spawner: Spawner) { | |||
| 70 | let seed = rng.next_u64(); | 70 | let seed = rng.next_u64(); |
| 71 | 71 | ||
| 72 | // Init network stack | 72 | // Init network stack |
| 73 | let stack = &*make_static!(Stack::new( | 73 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 74 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | ||
| 75 | let stack = &*STACK.init(Stack::new( | ||
| 74 | device, | 76 | device, |
| 75 | embassy_net::Config::dhcpv4(Default::default()), | 77 | embassy_net::Config::dhcpv4(Default::default()), |
| 76 | make_static!(StackResources::<3>::new()), | 78 | RESOURCES.init(StackResources::<3>::new()), |
| 77 | seed | 79 | seed, |
| 78 | )); | 80 | )); |
| 79 | 81 | ||
| 80 | // Launch network task | 82 | // Launch network task |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs index b19362fc1..975b3d385 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use core::str::FromStr; | 8 | use core::str::FromStr; |
| 10 | 9 | ||
| @@ -22,7 +21,7 @@ use embassy_time::{Delay, Duration, Timer}; | |||
| 22 | use embedded_hal_bus::spi::ExclusiveDevice; | 21 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 23 | use embedded_io_async::Write; | 22 | use embedded_io_async::Write; |
| 24 | use rand::RngCore; | 23 | use rand::RngCore; |
| 25 | use static_cell::make_static; | 24 | use static_cell::StaticCell; |
| 26 | use {defmt_rtt as _, panic_probe as _}; | 25 | use {defmt_rtt as _, panic_probe as _}; |
| 27 | 26 | ||
| 28 | #[embassy_executor::task] | 27 | #[embassy_executor::task] |
| @@ -58,7 +57,8 @@ async fn main(spawner: Spawner) { | |||
| 58 | let w5500_reset = Output::new(p.PIN_20, Level::High); | 57 | let w5500_reset = Output::new(p.PIN_20, Level::High); |
| 59 | 58 | ||
| 60 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 59 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 61 | let state = make_static!(State::<8, 8>::new()); | 60 | static STATE: StaticCell<State<8, 8>> = StaticCell::new(); |
| 61 | let state = STATE.init(State::<8, 8>::new()); | ||
| 62 | let (device, runner) = embassy_net_wiznet::new( | 62 | let (device, runner) = embassy_net_wiznet::new( |
| 63 | mac_addr, | 63 | mac_addr, |
| 64 | state, | 64 | state, |
| @@ -73,11 +73,13 @@ async fn main(spawner: Spawner) { | |||
| 73 | let seed = rng.next_u64(); | 73 | let seed = rng.next_u64(); |
| 74 | 74 | ||
| 75 | // Init network stack | 75 | // Init network stack |
| 76 | let stack = &*make_static!(Stack::new( | 76 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 77 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 78 | let stack = &*STACK.init(Stack::new( | ||
| 77 | device, | 79 | device, |
| 78 | embassy_net::Config::dhcpv4(Default::default()), | 80 | embassy_net::Config::dhcpv4(Default::default()), |
| 79 | make_static!(StackResources::<2>::new()), | 81 | RESOURCES.init(StackResources::<2>::new()), |
| 80 | seed | 82 | seed, |
| 81 | )); | 83 | )); |
| 82 | 84 | ||
| 83 | // Launch network task | 85 | // Launch network task |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs index c62caed7a..489af2c76 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | #![no_std] | 6 | #![no_std] |
| 7 | #![no_main] | 7 | #![no_main] |
| 8 | #![feature(type_alias_impl_trait)] | ||
| 9 | 8 | ||
| 10 | use defmt::*; | 9 | use defmt::*; |
| 11 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| @@ -21,7 +20,7 @@ use embassy_time::{Delay, Duration}; | |||
| 21 | use embedded_hal_bus::spi::ExclusiveDevice; | 20 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 22 | use embedded_io_async::Write; | 21 | use embedded_io_async::Write; |
| 23 | use rand::RngCore; | 22 | use rand::RngCore; |
| 24 | use static_cell::make_static; | 23 | use static_cell::StaticCell; |
| 25 | use {defmt_rtt as _, panic_probe as _}; | 24 | use {defmt_rtt as _, panic_probe as _}; |
| 26 | 25 | ||
| 27 | #[embassy_executor::task] | 26 | #[embassy_executor::task] |
| @@ -57,7 +56,8 @@ async fn main(spawner: Spawner) { | |||
| 57 | let w5500_reset = Output::new(p.PIN_20, Level::High); | 56 | let w5500_reset = Output::new(p.PIN_20, Level::High); |
| 58 | 57 | ||
| 59 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 58 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 60 | let state = make_static!(State::<8, 8>::new()); | 59 | static STATE: StaticCell<State<8, 8>> = StaticCell::new(); |
| 60 | let state = STATE.init(State::<8, 8>::new()); | ||
| 61 | let (device, runner) = embassy_net_wiznet::new( | 61 | let (device, runner) = embassy_net_wiznet::new( |
| 62 | mac_addr, | 62 | mac_addr, |
| 63 | state, | 63 | state, |
| @@ -72,11 +72,13 @@ async fn main(spawner: Spawner) { | |||
| 72 | let seed = rng.next_u64(); | 72 | let seed = rng.next_u64(); |
| 73 | 73 | ||
| 74 | // Init network stack | 74 | // Init network stack |
| 75 | let stack = &*make_static!(Stack::new( | 75 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 76 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 77 | let stack = &*STACK.init(Stack::new( | ||
| 76 | device, | 78 | device, |
| 77 | embassy_net::Config::dhcpv4(Default::default()), | 79 | embassy_net::Config::dhcpv4(Default::default()), |
| 78 | make_static!(StackResources::<2>::new()), | 80 | RESOURCES.init(StackResources::<2>::new()), |
| 79 | seed | 81 | seed, |
| 80 | )); | 82 | )); |
| 81 | 83 | ||
| 82 | // Launch network task | 84 | // Launch network task |
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs index 76dabce1c..41bd7d077 100644 --- a/examples/rp/src/bin/ethernet_w5500_udp.rs +++ b/examples/rp/src/bin/ethernet_w5500_udp.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| @@ -20,7 +19,7 @@ use embassy_rp::spi::{Async, Config as SpiConfig, Spi}; | |||
| 20 | use embassy_time::Delay; | 19 | use embassy_time::Delay; |
| 21 | use embedded_hal_bus::spi::ExclusiveDevice; | 20 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 22 | use rand::RngCore; | 21 | use rand::RngCore; |
| 23 | use static_cell::make_static; | 22 | use static_cell::StaticCell; |
| 24 | use {defmt_rtt as _, panic_probe as _}; | 23 | use {defmt_rtt as _, panic_probe as _}; |
| 25 | 24 | ||
| 26 | #[embassy_executor::task] | 25 | #[embassy_executor::task] |
| @@ -55,7 +54,8 @@ async fn main(spawner: Spawner) { | |||
| 55 | let w5500_reset = Output::new(p.PIN_20, Level::High); | 54 | let w5500_reset = Output::new(p.PIN_20, Level::High); |
| 56 | 55 | ||
| 57 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; | 56 | let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; |
| 58 | let state = make_static!(State::<8, 8>::new()); | 57 | static STATE: StaticCell<State<8, 8>> = StaticCell::new(); |
| 58 | let state = STATE.init(State::<8, 8>::new()); | ||
| 59 | let (device, runner) = embassy_net_wiznet::new( | 59 | let (device, runner) = embassy_net_wiznet::new( |
| 60 | mac_addr, | 60 | mac_addr, |
| 61 | state, | 61 | state, |
| @@ -70,11 +70,13 @@ async fn main(spawner: Spawner) { | |||
| 70 | let seed = rng.next_u64(); | 70 | let seed = rng.next_u64(); |
| 71 | 71 | ||
| 72 | // Init network stack | 72 | // Init network stack |
| 73 | let stack = &*make_static!(Stack::new( | 73 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 74 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 75 | let stack = &*STACK.init(Stack::new( | ||
| 74 | device, | 76 | device, |
| 75 | embassy_net::Config::dhcpv4(Default::default()), | 77 | embassy_net::Config::dhcpv4(Default::default()), |
| 76 | make_static!(StackResources::<2>::new()), | 78 | RESOURCES.init(StackResources::<2>::new()), |
| 77 | seed | 79 | seed, |
| 78 | )); | 80 | )); |
| 79 | 81 | ||
| 80 | // Launch network task | 82 | // Launch network task |
diff --git a/examples/rp/src/bin/flash.rs b/examples/rp/src/bin/flash.rs index 129a8497f..eb3e6a2b9 100644 --- a/examples/rp/src/bin/flash.rs +++ b/examples/rp/src/bin/flash.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | 5 | ||
| 7 | use defmt::*; | 6 | use defmt::*; |
| 8 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/gpio_async.rs b/examples/rp/src/bin/gpio_async.rs index 98209fe41..b79fb2a15 100644 --- a/examples/rp/src/bin/gpio_async.rs +++ b/examples/rp/src/bin/gpio_async.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/gpout.rs b/examples/rp/src/bin/gpout.rs index 896cc15ee..011359253 100644 --- a/examples/rp/src/bin/gpout.rs +++ b/examples/rp/src/bin/gpout.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/i2c_async.rs b/examples/rp/src/bin/i2c_async.rs index 7b53aae72..e31cc894c 100644 --- a/examples/rp/src/bin/i2c_async.rs +++ b/examples/rp/src/bin/i2c_async.rs | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | #![no_std] | 6 | #![no_std] |
| 7 | #![no_main] | 7 | #![no_main] |
| 8 | #![feature(type_alias_impl_trait)] | ||
| 9 | 8 | ||
| 10 | use defmt::*; | 9 | use defmt::*; |
| 11 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/i2c_blocking.rs b/examples/rp/src/bin/i2c_blocking.rs index 9ddb48d69..c9c8a2760 100644 --- a/examples/rp/src/bin/i2c_blocking.rs +++ b/examples/rp/src/bin/i2c_blocking.rs | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | #![no_std] | 6 | #![no_std] |
| 7 | #![no_main] | 7 | #![no_main] |
| 8 | #![feature(type_alias_impl_trait)] | ||
| 9 | 8 | ||
| 10 | use defmt::*; | 9 | use defmt::*; |
| 11 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/i2c_slave.rs b/examples/rp/src/bin/i2c_slave.rs index 151b083a4..479f9a16a 100644 --- a/examples/rp/src/bin/i2c_slave.rs +++ b/examples/rp/src/bin/i2c_slave.rs | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | //! This example shows how to use the 2040 as an i2c slave. | 1 | //! This example shows how to use the 2040 as an i2c slave. |
| 2 | #![no_std] | 2 | #![no_std] |
| 3 | #![no_main] | 3 | #![no_main] |
| 4 | #![feature(type_alias_impl_trait)] | ||
| 5 | 4 | ||
| 6 | use defmt::*; | 5 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/multicore.rs b/examples/rp/src/bin/multicore.rs index 43eaf8b0a..a1678d99a 100644 --- a/examples/rp/src/bin/multicore.rs +++ b/examples/rp/src/bin/multicore.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
diff --git a/examples/rp/src/bin/multiprio.rs b/examples/rp/src/bin/multiprio.rs index 28f621437..26b80c11d 100644 --- a/examples/rp/src/bin/multiprio.rs +++ b/examples/rp/src/bin/multiprio.rs | |||
| @@ -55,7 +55,6 @@ | |||
| 55 | 55 | ||
| 56 | #![no_std] | 56 | #![no_std] |
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | ||
| 59 | 58 | ||
| 60 | use cortex_m_rt::entry; | 59 | use cortex_m_rt::entry; |
| 61 | use defmt::{info, unwrap}; | 60 | use defmt::{info, unwrap}; |
diff --git a/examples/rp/src/bin/pio_async.rs b/examples/rp/src/bin/pio_async.rs index a6d6144be..ee248591b 100644 --- a/examples/rp/src/bin/pio_async.rs +++ b/examples/rp/src/bin/pio_async.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | use defmt::info; | 5 | use defmt::info; |
| 7 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 8 | use embassy_rp::bind_interrupts; | 7 | use embassy_rp::bind_interrupts; |
diff --git a/examples/rp/src/bin/pio_dma.rs b/examples/rp/src/bin/pio_dma.rs index 86e5017ac..02700269c 100644 --- a/examples/rp/src/bin/pio_dma.rs +++ b/examples/rp/src/bin/pio_dma.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | use defmt::info; | 5 | use defmt::info; |
| 7 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 8 | use embassy_futures::join::join; | 7 | use embassy_futures::join::join; |
diff --git a/examples/rp/src/bin/pio_hd44780.rs b/examples/rp/src/bin/pio_hd44780.rs index 5e5a6f9a3..3fab7b5f2 100644 --- a/examples/rp/src/bin/pio_hd44780.rs +++ b/examples/rp/src/bin/pio_hd44780.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | 6 | ||
| 8 | use core::fmt::Write; | 7 | use core::fmt::Write; |
| 9 | 8 | ||
diff --git a/examples/rp/src/bin/pio_rotary_encoder.rs b/examples/rp/src/bin/pio_rotary_encoder.rs index 6d9d59df6..58bdadbc0 100644 --- a/examples/rp/src/bin/pio_rotary_encoder.rs +++ b/examples/rp/src/bin/pio_rotary_encoder.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | 5 | ||
| 7 | use defmt::info; | 6 | use defmt::info; |
| 8 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/pio_stepper.rs b/examples/rp/src/bin/pio_stepper.rs index 02fb20699..ab9ecf623 100644 --- a/examples/rp/src/bin/pio_stepper.rs +++ b/examples/rp/src/bin/pio_stepper.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | use core::mem::{self, MaybeUninit}; | 6 | use core::mem::{self, MaybeUninit}; |
| 8 | 7 | ||
| 9 | use defmt::info; | 8 | use defmt::info; |
diff --git a/examples/rp/src/bin/pio_uart.rs b/examples/rp/src/bin/pio_uart.rs index c0ea23607..a07f1c180 100644 --- a/examples/rp/src/bin/pio_uart.rs +++ b/examples/rp/src/bin/pio_uart.rs | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #![no_std] | 9 | #![no_std] |
| 10 | #![no_main] | 10 | #![no_main] |
| 11 | #![feature(type_alias_impl_trait)] | ||
| 12 | #![allow(async_fn_in_trait)] | 11 | #![allow(async_fn_in_trait)] |
| 13 | 12 | ||
| 14 | use defmt::{info, panic, trace}; | 13 | use defmt::{info, panic, trace}; |
diff --git a/examples/rp/src/bin/pio_ws2812.rs b/examples/rp/src/bin/pio_ws2812.rs index 7b3259538..9a97cb8a7 100644 --- a/examples/rp/src/bin/pio_ws2812.rs +++ b/examples/rp/src/bin/pio_ws2812.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | 6 | ||
| 8 | use defmt::*; | 7 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/pwm.rs b/examples/rp/src/bin/pwm.rs index a99e88003..4fb62546d 100644 --- a/examples/rp/src/bin/pwm.rs +++ b/examples/rp/src/bin/pwm.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/pwm_input.rs b/examples/rp/src/bin/pwm_input.rs index 0fc2e40c3..e7bcbfbd4 100644 --- a/examples/rp/src/bin/pwm_input.rs +++ b/examples/rp/src/bin/pwm_input.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | 5 | ||
| 7 | use defmt::*; | 6 | use defmt::*; |
| 8 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/rosc.rs b/examples/rp/src/bin/rosc.rs index f841043b6..942b72319 100644 --- a/examples/rp/src/bin/rosc.rs +++ b/examples/rp/src/bin/rosc.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/rtc.rs b/examples/rp/src/bin/rtc.rs index 667876db5..e9a5e43a8 100644 --- a/examples/rp/src/bin/rtc.rs +++ b/examples/rp/src/bin/rtc.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | 5 | ||
| 7 | use defmt::*; | 6 | use defmt::*; |
| 8 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/spi.rs b/examples/rp/src/bin/spi.rs index 602348f7a..4cc4f5210 100644 --- a/examples/rp/src/bin/spi.rs +++ b/examples/rp/src/bin/spi.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/spi_async.rs b/examples/rp/src/bin/spi_async.rs index f5a2d334e..266584efc 100644 --- a/examples/rp/src/bin/spi_async.rs +++ b/examples/rp/src/bin/spi_async.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | 6 | ||
| 8 | use defmt::*; | 7 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/spi_display.rs b/examples/rp/src/bin/spi_display.rs index 26c258e1c..e937b9d0a 100644 --- a/examples/rp/src/bin/spi_display.rs +++ b/examples/rp/src/bin/spi_display.rs | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | #![no_std] | 6 | #![no_std] |
| 7 | #![no_main] | 7 | #![no_main] |
| 8 | #![feature(type_alias_impl_trait)] | ||
| 9 | 8 | ||
| 10 | use core::cell::RefCell; | 9 | use core::cell::RefCell; |
| 11 | 10 | ||
diff --git a/examples/rp/src/bin/uart.rs b/examples/rp/src/bin/uart.rs index 451c3c396..6a2816cd0 100644 --- a/examples/rp/src/bin/uart.rs +++ b/examples/rp/src/bin/uart.rs | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #![no_std] | 7 | #![no_std] |
| 8 | #![no_main] | 8 | #![no_main] |
| 9 | #![feature(type_alias_impl_trait)] | ||
| 10 | 9 | ||
| 11 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 12 | use embassy_rp::uart; | 11 | use embassy_rp::uart; |
diff --git a/examples/rp/src/bin/uart_buffered_split.rs b/examples/rp/src/bin/uart_buffered_split.rs index 14e8810a4..fac61aa04 100644 --- a/examples/rp/src/bin/uart_buffered_split.rs +++ b/examples/rp/src/bin/uart_buffered_split.rs | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #![no_std] | 7 | #![no_std] |
| 8 | #![no_main] | 8 | #![no_main] |
| 9 | #![feature(type_alias_impl_trait)] | ||
| 10 | 9 | ||
| 11 | use defmt::*; | 10 | use defmt::*; |
| 12 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| @@ -15,7 +14,7 @@ use embassy_rp::peripherals::UART0; | |||
| 15 | use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config}; | 14 | use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config}; |
| 16 | use embassy_time::Timer; | 15 | use embassy_time::Timer; |
| 17 | use embedded_io_async::{Read, Write}; | 16 | use embedded_io_async::{Read, Write}; |
| 18 | use static_cell::make_static; | 17 | use static_cell::StaticCell; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | 19 | ||
| 21 | bind_interrupts!(struct Irqs { | 20 | bind_interrupts!(struct Irqs { |
| @@ -27,8 +26,10 @@ async fn main(spawner: Spawner) { | |||
| 27 | let p = embassy_rp::init(Default::default()); | 26 | let p = embassy_rp::init(Default::default()); |
| 28 | let (tx_pin, rx_pin, uart) = (p.PIN_0, p.PIN_1, p.UART0); | 27 | let (tx_pin, rx_pin, uart) = (p.PIN_0, p.PIN_1, p.UART0); |
| 29 | 28 | ||
| 30 | let tx_buf = &mut make_static!([0u8; 16])[..]; | 29 | static TX_BUF: StaticCell<[u8; 16]> = StaticCell::new(); |
| 31 | let rx_buf = &mut make_static!([0u8; 16])[..]; | 30 | let tx_buf = &mut TX_BUF.init([0; 16])[..]; |
| 31 | static RX_BUF: StaticCell<[u8; 16]> = StaticCell::new(); | ||
| 32 | let rx_buf = &mut RX_BUF.init([0; 16])[..]; | ||
| 32 | let uart = BufferedUart::new(uart, Irqs, tx_pin, rx_pin, tx_buf, rx_buf, Config::default()); | 33 | let uart = BufferedUart::new(uart, Irqs, tx_pin, rx_pin, tx_buf, rx_buf, Config::default()); |
| 33 | let (rx, mut tx) = uart.split(); | 34 | let (rx, mut tx) = uart.split(); |
| 34 | 35 | ||
diff --git a/examples/rp/src/bin/uart_unidir.rs b/examples/rp/src/bin/uart_unidir.rs index 42c8b432e..a45f40756 100644 --- a/examples/rp/src/bin/uart_unidir.rs +++ b/examples/rp/src/bin/uart_unidir.rs | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | 7 | ||
| 8 | #![no_std] | 8 | #![no_std] |
| 9 | #![no_main] | 9 | #![no_main] |
| 10 | #![feature(type_alias_impl_trait)] | ||
| 11 | 10 | ||
| 12 | use defmt::*; | 11 | use defmt::*; |
| 13 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs index cc63029fb..01f0d5967 100644 --- a/examples/rp/src/bin/usb_ethernet.rs +++ b/examples/rp/src/bin/usb_ethernet.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| @@ -17,7 +16,7 @@ use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState | |||
| 17 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; | 16 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; |
| 18 | use embassy_usb::{Builder, Config, UsbDevice}; | 17 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 19 | use embedded_io_async::Write; | 18 | use embedded_io_async::Write; |
| 20 | use static_cell::make_static; | 19 | use static_cell::StaticCell; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | 20 | use {defmt_rtt as _, panic_probe as _}; |
| 22 | 21 | ||
| 23 | bind_interrupts!(struct Irqs { | 22 | bind_interrupts!(struct Irqs { |
| @@ -65,14 +64,18 @@ async fn main(spawner: Spawner) { | |||
| 65 | config.device_protocol = 0x01; | 64 | config.device_protocol = 0x01; |
| 66 | 65 | ||
| 67 | // Create embassy-usb DeviceBuilder using the driver and config. | 66 | // Create embassy-usb DeviceBuilder using the driver and config. |
| 67 | static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 68 | static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 69 | static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 70 | static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new(); | ||
| 68 | let mut builder = Builder::new( | 71 | let mut builder = Builder::new( |
| 69 | driver, | 72 | driver, |
| 70 | config, | 73 | config, |
| 71 | &mut make_static!([0; 256])[..], | 74 | &mut DEVICE_DESC.init([0; 256])[..], |
| 72 | &mut make_static!([0; 256])[..], | 75 | &mut CONFIG_DESC.init([0; 256])[..], |
| 73 | &mut make_static!([0; 256])[..], | 76 | &mut BOS_DESC.init([0; 256])[..], |
| 74 | &mut [], // no msos descriptors | 77 | &mut [], // no msos descriptors |
| 75 | &mut make_static!([0; 128])[..], | 78 | &mut CONTROL_BUF.init([0; 128])[..], |
| 76 | ); | 79 | ); |
| 77 | 80 | ||
| 78 | // Our MAC addr. | 81 | // Our MAC addr. |
| @@ -81,14 +84,16 @@ async fn main(spawner: Spawner) { | |||
| 81 | let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; | 84 | let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; |
| 82 | 85 | ||
| 83 | // Create classes on the builder. | 86 | // Create classes on the builder. |
| 84 | let class = CdcNcmClass::new(&mut builder, make_static!(State::new()), host_mac_addr, 64); | 87 | static STATE: StaticCell<State> = StaticCell::new(); |
| 88 | let class = CdcNcmClass::new(&mut builder, STATE.init(State::new()), host_mac_addr, 64); | ||
| 85 | 89 | ||
| 86 | // Build the builder. | 90 | // Build the builder. |
| 87 | let usb = builder.build(); | 91 | let usb = builder.build(); |
| 88 | 92 | ||
| 89 | unwrap!(spawner.spawn(usb_task(usb))); | 93 | unwrap!(spawner.spawn(usb_task(usb))); |
| 90 | 94 | ||
| 91 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); | 95 | static NET_STATE: StaticCell<NetState<MTU, 4, 4>> = StaticCell::new(); |
| 96 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(NET_STATE.init(NetState::new()), our_mac_addr); | ||
| 92 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 97 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 93 | 98 | ||
| 94 | let config = embassy_net::Config::dhcpv4(Default::default()); | 99 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| @@ -102,11 +107,13 @@ async fn main(spawner: Spawner) { | |||
| 102 | let seed = 1234; // guaranteed random, chosen by a fair dice roll | 107 | let seed = 1234; // guaranteed random, chosen by a fair dice roll |
| 103 | 108 | ||
| 104 | // Init network stack | 109 | // Init network stack |
| 105 | let stack = &*make_static!(Stack::new( | 110 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); |
| 111 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 112 | let stack = &*STACK.init(Stack::new( | ||
| 106 | device, | 113 | device, |
| 107 | config, | 114 | config, |
| 108 | make_static!(StackResources::<2>::new()), | 115 | RESOURCES.init(StackResources::<2>::new()), |
| 109 | seed | 116 | seed, |
| 110 | )); | 117 | )); |
| 111 | 118 | ||
| 112 | unwrap!(spawner.spawn(net_task(stack))); | 119 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/rp/src/bin/usb_hid_keyboard.rs b/examples/rp/src/bin/usb_hid_keyboard.rs index 569c9b12b..b5ac16245 100644 --- a/examples/rp/src/bin/usb_hid_keyboard.rs +++ b/examples/rp/src/bin/usb_hid_keyboard.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::sync::atomic::{AtomicBool, Ordering}; | 4 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 6 | 5 | ||
diff --git a/examples/rp/src/bin/usb_logger.rs b/examples/rp/src/bin/usb_logger.rs index 791f15e56..af401ed63 100644 --- a/examples/rp/src/bin/usb_logger.rs +++ b/examples/rp/src/bin/usb_logger.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::bind_interrupts; | 9 | use embassy_rp::bind_interrupts; |
diff --git a/examples/rp/src/bin/usb_midi.rs b/examples/rp/src/bin/usb_midi.rs index d5cdae319..95306a35c 100644 --- a/examples/rp/src/bin/usb_midi.rs +++ b/examples/rp/src/bin/usb_midi.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::{info, panic}; | 8 | use defmt::{info, panic}; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/usb_raw.rs b/examples/rp/src/bin/usb_raw.rs index f59262e5c..a6c8a5b2e 100644 --- a/examples/rp/src/bin/usb_raw.rs +++ b/examples/rp/src/bin/usb_raw.rs | |||
| @@ -48,7 +48,6 @@ | |||
| 48 | 48 | ||
| 49 | #![no_std] | 49 | #![no_std] |
| 50 | #![no_main] | 50 | #![no_main] |
| 51 | #![feature(type_alias_impl_trait)] | ||
| 52 | 51 | ||
| 53 | use defmt::info; | 52 | use defmt::info; |
| 54 | use embassy_executor::Spawner; | 53 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/usb_raw_bulk.rs b/examples/rp/src/bin/usb_raw_bulk.rs index 288be5a4e..0dc8e9f72 100644 --- a/examples/rp/src/bin/usb_raw_bulk.rs +++ b/examples/rp/src/bin/usb_raw_bulk.rs | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | #![no_std] | 27 | #![no_std] |
| 28 | #![no_main] | 28 | #![no_main] |
| 29 | #![feature(type_alias_impl_trait)] | ||
| 30 | 29 | ||
| 31 | use defmt::info; | 30 | use defmt::info; |
| 32 | use embassy_executor::Spawner; | 31 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/usb_serial.rs b/examples/rp/src/bin/usb_serial.rs index 30347d920..ab24a994c 100644 --- a/examples/rp/src/bin/usb_serial.rs +++ b/examples/rp/src/bin/usb_serial.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::{info, panic}; | 8 | use defmt::{info, panic}; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/watchdog.rs b/examples/rp/src/bin/watchdog.rs index b6af518af..b9d4ef22f 100644 --- a/examples/rp/src/bin/watchdog.rs +++ b/examples/rp/src/bin/watchdog.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use defmt::info; | 8 | use defmt::info; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs index ad1fa6462..1bd75607e 100644 --- a/examples/rp/src/bin/wifi_ap_tcp_server.rs +++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | #![allow(async_fn_in_trait)] | 6 | #![allow(async_fn_in_trait)] |
| 8 | 7 | ||
| 9 | use core::str::from_utf8; | 8 | use core::str::from_utf8; |
| @@ -19,7 +18,7 @@ use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; | |||
| 19 | use embassy_rp::pio::{InterruptHandler, Pio}; | 18 | use embassy_rp::pio::{InterruptHandler, Pio}; |
| 20 | use embassy_time::Duration; | 19 | use embassy_time::Duration; |
| 21 | use embedded_io_async::Write; | 20 | use embedded_io_async::Write; |
| 22 | use static_cell::make_static; | 21 | use static_cell::StaticCell; |
| 23 | use {defmt_rtt as _, panic_probe as _}; | 22 | use {defmt_rtt as _, panic_probe as _}; |
| 24 | 23 | ||
| 25 | bind_interrupts!(struct Irqs { | 24 | bind_interrupts!(struct Irqs { |
| @@ -59,7 +58,8 @@ async fn main(spawner: Spawner) { | |||
| 59 | let mut pio = Pio::new(p.PIO0, Irqs); | 58 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 60 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 59 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); |
| 61 | 60 | ||
| 62 | let state = make_static!(cyw43::State::new()); | 61 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 62 | let state = STATE.init(cyw43::State::new()); | ||
| 63 | let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; | 63 | let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; |
| 64 | unwrap!(spawner.spawn(wifi_task(runner))); | 64 | unwrap!(spawner.spawn(wifi_task(runner))); |
| 65 | 65 | ||
| @@ -79,11 +79,13 @@ async fn main(spawner: Spawner) { | |||
| 79 | let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random. | 79 | let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random. |
| 80 | 80 | ||
| 81 | // Init network stack | 81 | // Init network stack |
| 82 | let stack = &*make_static!(Stack::new( | 82 | static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new(); |
| 83 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 84 | let stack = &*STACK.init(Stack::new( | ||
| 83 | net_device, | 85 | net_device, |
| 84 | config, | 86 | config, |
| 85 | make_static!(StackResources::<2>::new()), | 87 | RESOURCES.init(StackResources::<2>::new()), |
| 86 | seed | 88 | seed, |
| 87 | )); | 89 | )); |
| 88 | 90 | ||
| 89 | unwrap!(spawner.spawn(net_task(stack))); | 91 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/rp/src/bin/wifi_blinky.rs b/examples/rp/src/bin/wifi_blinky.rs index 14ace74e9..1ed74993c 100644 --- a/examples/rp/src/bin/wifi_blinky.rs +++ b/examples/rp/src/bin/wifi_blinky.rs | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #![no_std] | 5 | #![no_std] |
| 6 | #![no_main] | 6 | #![no_main] |
| 7 | #![feature(type_alias_impl_trait)] | ||
| 8 | 7 | ||
| 9 | use cyw43_pio::PioSpi; | 8 | use cyw43_pio::PioSpi; |
| 10 | use defmt::*; | 9 | use defmt::*; |
| @@ -14,7 +13,7 @@ use embassy_rp::gpio::{Level, Output}; | |||
| 14 | use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; | 13 | use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; |
| 15 | use embassy_rp::pio::{InterruptHandler, Pio}; | 14 | use embassy_rp::pio::{InterruptHandler, Pio}; |
| 16 | use embassy_time::{Duration, Timer}; | 15 | use embassy_time::{Duration, Timer}; |
| 17 | use static_cell::make_static; | 16 | use static_cell::StaticCell; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | 18 | ||
| 20 | bind_interrupts!(struct Irqs { | 19 | bind_interrupts!(struct Irqs { |
| @@ -46,7 +45,8 @@ async fn main(spawner: Spawner) { | |||
| 46 | let mut pio = Pio::new(p.PIO0, Irqs); | 45 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 47 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 46 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); |
| 48 | 47 | ||
| 49 | let state = make_static!(cyw43::State::new()); | 48 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 49 | let state = STATE.init(cyw43::State::new()); | ||
| 50 | let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; | 50 | let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; |
| 51 | unwrap!(spawner.spawn(wifi_task(runner))); | 51 | unwrap!(spawner.spawn(wifi_task(runner))); |
| 52 | 52 | ||
diff --git a/examples/rp/src/bin/wifi_scan.rs b/examples/rp/src/bin/wifi_scan.rs index 7adf52b88..45bb5b76c 100644 --- a/examples/rp/src/bin/wifi_scan.rs +++ b/examples/rp/src/bin/wifi_scan.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | #![allow(async_fn_in_trait)] | 6 | #![allow(async_fn_in_trait)] |
| 8 | 7 | ||
| 9 | use core::str; | 8 | use core::str; |
| @@ -16,7 +15,7 @@ use embassy_rp::bind_interrupts; | |||
| 16 | use embassy_rp::gpio::{Level, Output}; | 15 | use embassy_rp::gpio::{Level, Output}; |
| 17 | use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; | 16 | use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; |
| 18 | use embassy_rp::pio::{InterruptHandler, Pio}; | 17 | use embassy_rp::pio::{InterruptHandler, Pio}; |
| 19 | use static_cell::make_static; | 18 | use static_cell::StaticCell; |
| 20 | use {defmt_rtt as _, panic_probe as _}; | 19 | use {defmt_rtt as _, panic_probe as _}; |
| 21 | 20 | ||
| 22 | bind_interrupts!(struct Irqs { | 21 | bind_interrupts!(struct Irqs { |
| @@ -56,7 +55,8 @@ async fn main(spawner: Spawner) { | |||
| 56 | let mut pio = Pio::new(p.PIO0, Irqs); | 55 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 57 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 56 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); |
| 58 | 57 | ||
| 59 | let state = make_static!(cyw43::State::new()); | 58 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 59 | let state = STATE.init(cyw43::State::new()); | ||
| 60 | let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; | 60 | let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; |
| 61 | unwrap!(spawner.spawn(wifi_task(runner))); | 61 | unwrap!(spawner.spawn(wifi_task(runner))); |
| 62 | 62 | ||
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs index ec6b4ee74..c346f1ded 100644 --- a/examples/rp/src/bin/wifi_tcp_server.rs +++ b/examples/rp/src/bin/wifi_tcp_server.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #![no_std] | 4 | #![no_std] |
| 5 | #![no_main] | 5 | #![no_main] |
| 6 | #![feature(type_alias_impl_trait)] | ||
| 7 | #![allow(async_fn_in_trait)] | 6 | #![allow(async_fn_in_trait)] |
| 8 | 7 | ||
| 9 | use core::str::from_utf8; | 8 | use core::str::from_utf8; |
| @@ -19,7 +18,7 @@ use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; | |||
| 19 | use embassy_rp::pio::{InterruptHandler, Pio}; | 18 | use embassy_rp::pio::{InterruptHandler, Pio}; |
| 20 | use embassy_time::{Duration, Timer}; | 19 | use embassy_time::{Duration, Timer}; |
| 21 | use embedded_io_async::Write; | 20 | use embedded_io_async::Write; |
| 22 | use static_cell::make_static; | 21 | use static_cell::StaticCell; |
| 23 | use {defmt_rtt as _, panic_probe as _}; | 22 | use {defmt_rtt as _, panic_probe as _}; |
| 24 | 23 | ||
| 25 | bind_interrupts!(struct Irqs { | 24 | bind_interrupts!(struct Irqs { |
| @@ -62,7 +61,8 @@ async fn main(spawner: Spawner) { | |||
| 62 | let mut pio = Pio::new(p.PIO0, Irqs); | 61 | let mut pio = Pio::new(p.PIO0, Irqs); |
| 63 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); | 62 | let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); |
| 64 | 63 | ||
| 65 | let state = make_static!(cyw43::State::new()); | 64 | static STATE: StaticCell<cyw43::State> = StaticCell::new(); |
| 65 | let state = STATE.init(cyw43::State::new()); | ||
| 66 | let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; | 66 | let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; |
| 67 | unwrap!(spawner.spawn(wifi_task(runner))); | 67 | unwrap!(spawner.spawn(wifi_task(runner))); |
| 68 | 68 | ||
| @@ -82,11 +82,13 @@ async fn main(spawner: Spawner) { | |||
| 82 | let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random. | 82 | let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random. |
| 83 | 83 | ||
| 84 | // Init network stack | 84 | // Init network stack |
| 85 | let stack = &*make_static!(Stack::new( | 85 | static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new(); |
| 86 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 87 | let stack = &*STACK.init(Stack::new( | ||
| 86 | net_device, | 88 | net_device, |
| 87 | config, | 89 | config, |
| 88 | make_static!(StackResources::<2>::new()), | 90 | RESOURCES.init(StackResources::<2>::new()), |
| 89 | seed | 91 | seed, |
| 90 | )); | 92 | )); |
| 91 | 93 | ||
| 92 | unwrap!(spawner.spawn(net_task(stack))); | 94 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index ccc0a4afc..a4f306865 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["log"] } | 8 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["log"] } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["log", "std", ] } | 10 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["log", "std", ] } |
| 11 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } | 11 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } |
| 12 | embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } | 12 | embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } |
| @@ -23,7 +23,7 @@ nix = "0.26.2" | |||
| 23 | clap = { version = "3.0.0-beta.5", features = ["derive"] } | 23 | clap = { version = "3.0.0-beta.5", features = ["derive"] } |
| 24 | rand_core = { version = "0.6.3", features = ["std"] } | 24 | rand_core = { version = "0.6.3", features = ["std"] } |
| 25 | heapless = { version = "0.8", default-features = false } | 25 | heapless = { version = "0.8", default-features = false } |
| 26 | static_cell = { version = "2", features = ["nightly"]} | 26 | static_cell = "2" |
| 27 | 27 | ||
| 28 | [profile.release] | 28 | [profile.release] |
| 29 | debug = 2 | 29 | debug = 2 |
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs index 8d8345057..dad93d0a1 100644 --- a/examples/std/src/bin/net.rs +++ b/examples/std/src/bin/net.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | ||
| 2 | |||
| 3 | use std::default::Default; | 1 | use std::default::Default; |
| 4 | 2 | ||
| 5 | use clap::Parser; | 3 | use clap::Parser; |
| @@ -12,7 +10,7 @@ use embedded_io_async::Write; | |||
| 12 | use heapless::Vec; | 10 | use heapless::Vec; |
| 13 | use log::*; | 11 | use log::*; |
| 14 | use rand_core::{OsRng, RngCore}; | 12 | use rand_core::{OsRng, RngCore}; |
| 15 | use static_cell::{make_static, StaticCell}; | 13 | use static_cell::StaticCell; |
| 16 | 14 | ||
| 17 | #[derive(Parser)] | 15 | #[derive(Parser)] |
| 18 | #[clap(version = "1.0")] | 16 | #[clap(version = "1.0")] |
| @@ -54,11 +52,13 @@ async fn main_task(spawner: Spawner) { | |||
| 54 | let seed = u64::from_le_bytes(seed); | 52 | let seed = u64::from_le_bytes(seed); |
| 55 | 53 | ||
| 56 | // Init network stack | 54 | // Init network stack |
| 57 | let stack = &*make_static!(Stack::new( | 55 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); |
| 56 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | ||
| 57 | let stack = &*STACK.init(Stack::new( | ||
| 58 | device, | 58 | device, |
| 59 | config, | 59 | config, |
| 60 | make_static!(StackResources::<3>::new()), | 60 | RESOURCES.init(StackResources::<3>::new()), |
| 61 | seed | 61 | seed, |
| 62 | )); | 62 | )); |
| 63 | 63 | ||
| 64 | // Launch network task | 64 | // Launch network task |
diff --git a/examples/std/src/bin/net_dns.rs b/examples/std/src/bin/net_dns.rs index 6c19874d5..fca1e076e 100644 --- a/examples/std/src/bin/net_dns.rs +++ b/examples/std/src/bin/net_dns.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | ||
| 2 | |||
| 3 | use std::default::Default; | 1 | use std::default::Default; |
| 4 | 2 | ||
| 5 | use clap::Parser; | 3 | use clap::Parser; |
| @@ -10,7 +8,7 @@ use embassy_net_tuntap::TunTapDevice; | |||
| 10 | use heapless::Vec; | 8 | use heapless::Vec; |
| 11 | use log::*; | 9 | use log::*; |
| 12 | use rand_core::{OsRng, RngCore}; | 10 | use rand_core::{OsRng, RngCore}; |
| 13 | use static_cell::{make_static, StaticCell}; | 11 | use static_cell::StaticCell; |
| 14 | 12 | ||
| 15 | #[derive(Parser)] | 13 | #[derive(Parser)] |
| 16 | #[clap(version = "1.0")] | 14 | #[clap(version = "1.0")] |
| @@ -53,11 +51,13 @@ async fn main_task(spawner: Spawner) { | |||
| 53 | let seed = u64::from_le_bytes(seed); | 51 | let seed = u64::from_le_bytes(seed); |
| 54 | 52 | ||
| 55 | // Init network stack | 53 | // Init network stack |
| 56 | let stack: &Stack<_> = &*make_static!(Stack::new( | 54 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); |
| 55 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | ||
| 56 | let stack: &Stack<_> = &*STACK.init(Stack::new( | ||
| 57 | device, | 57 | device, |
| 58 | config, | 58 | config, |
| 59 | make_static!(StackResources::<3>::new()), | 59 | RESOURCES.init(StackResources::<3>::new()), |
| 60 | seed | 60 | seed, |
| 61 | )); | 61 | )); |
| 62 | 62 | ||
| 63 | // Launch network task | 63 | // Launch network task |
diff --git a/examples/std/src/bin/net_ppp.rs b/examples/std/src/bin/net_ppp.rs index cee04e558..9ec0ea91f 100644 --- a/examples/std/src/bin/net_ppp.rs +++ b/examples/std/src/bin/net_ppp.rs | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | //! ping 192.168.7.10 | 7 | //! ping 192.168.7.10 |
| 8 | //! nc 192.168.7.10 1234 | 8 | //! nc 192.168.7.10 1234 |
| 9 | 9 | ||
| 10 | #![feature(type_alias_impl_trait)] | ||
| 11 | #![allow(async_fn_in_trait)] | 10 | #![allow(async_fn_in_trait)] |
| 12 | 11 | ||
| 13 | #[path = "../serial_port.rs"] | 12 | #[path = "../serial_port.rs"] |
| @@ -25,7 +24,7 @@ use heapless::Vec; | |||
| 25 | use log::*; | 24 | use log::*; |
| 26 | use nix::sys::termios; | 25 | use nix::sys::termios; |
| 27 | use rand_core::{OsRng, RngCore}; | 26 | use rand_core::{OsRng, RngCore}; |
| 28 | use static_cell::{make_static, StaticCell}; | 27 | use static_cell::StaticCell; |
| 29 | 28 | ||
| 30 | use crate::serial_port::SerialPort; | 29 | use crate::serial_port::SerialPort; |
| 31 | 30 | ||
| @@ -88,7 +87,8 @@ async fn main_task(spawner: Spawner) { | |||
| 88 | let port = SerialPort::new(opts.device.as_str(), baudrate).unwrap(); | 87 | let port = SerialPort::new(opts.device.as_str(), baudrate).unwrap(); |
| 89 | 88 | ||
| 90 | // Init network device | 89 | // Init network device |
| 91 | let state = make_static!(embassy_net_ppp::State::<4, 4>::new()); | 90 | static STATE: StaticCell<embassy_net_ppp::State<4, 4>> = StaticCell::new(); |
| 91 | let state = STATE.init(embassy_net_ppp::State::<4, 4>::new()); | ||
| 92 | let (device, runner) = embassy_net_ppp::new(state); | 92 | let (device, runner) = embassy_net_ppp::new(state); |
| 93 | 93 | ||
| 94 | // Generate random seed | 94 | // Generate random seed |
| @@ -97,11 +97,13 @@ async fn main_task(spawner: Spawner) { | |||
| 97 | let seed = u64::from_le_bytes(seed); | 97 | let seed = u64::from_le_bytes(seed); |
| 98 | 98 | ||
| 99 | // Init network stack | 99 | // Init network stack |
| 100 | let stack = &*make_static!(Stack::new( | 100 | static STACK: StaticCell<Stack<embassy_net_ppp::Device<'static>>> = StaticCell::new(); |
| 101 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | ||
| 102 | let stack = &*STACK.init(Stack::new( | ||
| 101 | device, | 103 | device, |
| 102 | Config::default(), // don't configure IP yet | 104 | Config::default(), // don't configure IP yet |
| 103 | make_static!(StackResources::<3>::new()), | 105 | RESOURCES.init(StackResources::<3>::new()), |
| 104 | seed | 106 | seed, |
| 105 | )); | 107 | )); |
| 106 | 108 | ||
| 107 | // Launch network task | 109 | // Launch network task |
diff --git a/examples/std/src/bin/net_udp.rs b/examples/std/src/bin/net_udp.rs index 98dcc9925..bee91990d 100644 --- a/examples/std/src/bin/net_udp.rs +++ b/examples/std/src/bin/net_udp.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | ||
| 2 | |||
| 3 | use clap::Parser; | 1 | use clap::Parser; |
| 4 | use embassy_executor::{Executor, Spawner}; | 2 | use embassy_executor::{Executor, Spawner}; |
| 5 | use embassy_net::udp::{PacketMetadata, UdpSocket}; | 3 | use embassy_net::udp::{PacketMetadata, UdpSocket}; |
| @@ -8,7 +6,7 @@ use embassy_net_tuntap::TunTapDevice; | |||
| 8 | use heapless::Vec; | 6 | use heapless::Vec; |
| 9 | use log::*; | 7 | use log::*; |
| 10 | use rand_core::{OsRng, RngCore}; | 8 | use rand_core::{OsRng, RngCore}; |
| 11 | use static_cell::{make_static, StaticCell}; | 9 | use static_cell::StaticCell; |
| 12 | 10 | ||
| 13 | #[derive(Parser)] | 11 | #[derive(Parser)] |
| 14 | #[clap(version = "1.0")] | 12 | #[clap(version = "1.0")] |
| @@ -50,11 +48,13 @@ async fn main_task(spawner: Spawner) { | |||
| 50 | let seed = u64::from_le_bytes(seed); | 48 | let seed = u64::from_le_bytes(seed); |
| 51 | 49 | ||
| 52 | // Init network stack | 50 | // Init network stack |
| 53 | let stack = &*make_static!(Stack::new( | 51 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); |
| 52 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | ||
| 53 | let stack = &*STACK.init(Stack::new( | ||
| 54 | device, | 54 | device, |
| 55 | config, | 55 | config, |
| 56 | make_static!(StackResources::<3>::new()), | 56 | RESOURCES.init(StackResources::<3>::new()), |
| 57 | seed | 57 | seed, |
| 58 | )); | 58 | )); |
| 59 | 59 | ||
| 60 | // Launch network task | 60 | // Launch network task |
diff --git a/examples/std/src/bin/serial.rs b/examples/std/src/bin/serial.rs index 0b289c74d..435089aad 100644 --- a/examples/std/src/bin/serial.rs +++ b/examples/std/src/bin/serial.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | ||
| 2 | |||
| 3 | #[path = "../serial_port.rs"] | 1 | #[path = "../serial_port.rs"] |
| 4 | mod serial_port; | 2 | mod serial_port; |
| 5 | 3 | ||
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs index 79fa375cd..00ccd83a7 100644 --- a/examples/std/src/bin/tcp_accept.rs +++ b/examples/std/src/bin/tcp_accept.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | ||
| 2 | |||
| 3 | use core::fmt::Write as _; | 1 | use core::fmt::Write as _; |
| 4 | use std::default::Default; | 2 | use std::default::Default; |
| 5 | 3 | ||
| @@ -13,7 +11,7 @@ use embedded_io_async::Write as _; | |||
| 13 | use heapless::Vec; | 11 | use heapless::Vec; |
| 14 | use log::*; | 12 | use log::*; |
| 15 | use rand_core::{OsRng, RngCore}; | 13 | use rand_core::{OsRng, RngCore}; |
| 16 | use static_cell::{make_static, StaticCell}; | 14 | use static_cell::StaticCell; |
| 17 | 15 | ||
| 18 | #[derive(Parser)] | 16 | #[derive(Parser)] |
| 19 | #[clap(version = "1.0")] | 17 | #[clap(version = "1.0")] |
| @@ -65,11 +63,13 @@ async fn main_task(spawner: Spawner) { | |||
| 65 | let seed = u64::from_le_bytes(seed); | 63 | let seed = u64::from_le_bytes(seed); |
| 66 | 64 | ||
| 67 | // Init network stack | 65 | // Init network stack |
| 68 | let stack = &*make_static!(Stack::new( | 66 | static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new(); |
| 67 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | ||
| 68 | let stack = &*STACK.init(Stack::new( | ||
| 69 | device, | 69 | device, |
| 70 | config, | 70 | config, |
| 71 | make_static!(StackResources::<3>::new()), | 71 | RESOURCES.init(StackResources::<3>::new()), |
| 72 | seed | 72 | seed, |
| 73 | )); | 73 | )); |
| 74 | 74 | ||
| 75 | // Launch network task | 75 | // Launch network task |
diff --git a/examples/std/src/bin/tick.rs b/examples/std/src/bin/tick.rs index a3f99067e..f23cf3549 100644 --- a/examples/std/src/bin/tick.rs +++ b/examples/std/src/bin/tick.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | ||
| 2 | |||
| 3 | use embassy_executor::Spawner; | 1 | use embassy_executor::Spawner; |
| 4 | use embassy_time::Timer; | 2 | use embassy_time::Timer; |
| 5 | use log::*; | 3 | use log::*; |
diff --git a/examples/stm32c0/Cargo.toml b/examples/stm32c0/Cargo.toml index 2d831ba5d..0fd3939c6 100644 --- a/examples/stm32c0/Cargo.toml +++ b/examples/stm32c0/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32c031c6 to your chip name, if necessary. | 8 | # Change stm32c031c6 to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | 13 | ||
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
diff --git a/examples/stm32c0/src/bin/blinky.rs b/examples/stm32c0/src/bin/blinky.rs index cbeb0dee1..90e479aae 100644 --- a/examples/stm32c0/src/bin/blinky.rs +++ b/examples/stm32c0/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32c0/src/bin/button.rs b/examples/stm32c0/src/bin/button.rs index 40c58013b..265200132 100644 --- a/examples/stm32c0/src/bin/button.rs +++ b/examples/stm32c0/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32c0/src/bin/button_exti.rs b/examples/stm32c0/src/bin/button_exti.rs index ef32d4c4a..1e970fdd6 100644 --- a/examples/stm32c0/src/bin/button_exti.rs +++ b/examples/stm32c0/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml index 2b066d731..9fdc4798a 100644 --- a/examples/stm32f0/Cargo.toml +++ b/examples/stm32f0/Cargo.toml | |||
| @@ -15,9 +15,9 @@ defmt = "0.3" | |||
| 15 | defmt-rtt = "0.4" | 15 | defmt-rtt = "0.4" |
| 16 | panic-probe = "0.3" | 16 | panic-probe = "0.3" |
| 17 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 17 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 18 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 18 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 19 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 19 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 20 | static_cell = { version = "2", features = ["nightly"]} | 20 | static_cell = "2" |
| 21 | portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] } | 21 | portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] } |
| 22 | 22 | ||
| 23 | [profile.release] | 23 | [profile.release] |
diff --git a/examples/stm32f0/src/bin/adc.rs b/examples/stm32f0/src/bin/adc.rs index 96f234402..8fef062b3 100644 --- a/examples/stm32f0/src/bin/adc.rs +++ b/examples/stm32f0/src/bin/adc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f0/src/bin/blinky.rs b/examples/stm32f0/src/bin/blinky.rs index 899394546..2572be1bc 100644 --- a/examples/stm32f0/src/bin/blinky.rs +++ b/examples/stm32f0/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f0/src/bin/button_controlled_blink.rs b/examples/stm32f0/src/bin/button_controlled_blink.rs index 306df1752..360d153c3 100644 --- a/examples/stm32f0/src/bin/button_controlled_blink.rs +++ b/examples/stm32f0/src/bin/button_controlled_blink.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #![no_std] | 3 | #![no_std] |
| 4 | #![no_main] | 4 | #![no_main] |
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | 5 | ||
| 7 | use core::sync::atomic::{AtomicU32, Ordering}; | 6 | use core::sync::atomic::{AtomicU32, Ordering}; |
| 8 | 7 | ||
diff --git a/examples/stm32f0/src/bin/button_exti.rs b/examples/stm32f0/src/bin/button_exti.rs index 40c0d5848..ce17c1a48 100644 --- a/examples/stm32f0/src/bin/button_exti.rs +++ b/examples/stm32f0/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f0/src/bin/hello.rs b/examples/stm32f0/src/bin/hello.rs index 0f98d9865..ccd6a0a39 100644 --- a/examples/stm32f0/src/bin/hello.rs +++ b/examples/stm32f0/src/bin/hello.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f0/src/bin/multiprio.rs b/examples/stm32f0/src/bin/multiprio.rs index 870c7c45b..e49951726 100644 --- a/examples/stm32f0/src/bin/multiprio.rs +++ b/examples/stm32f0/src/bin/multiprio.rs | |||
| @@ -55,7 +55,6 @@ | |||
| 55 | 55 | ||
| 56 | #![no_std] | 56 | #![no_std] |
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | ||
| 59 | 58 | ||
| 60 | use cortex_m_rt::entry; | 59 | use cortex_m_rt::entry; |
| 61 | use defmt::*; | 60 | use defmt::*; |
diff --git a/examples/stm32f0/src/bin/wdg.rs b/examples/stm32f0/src/bin/wdg.rs index b51dee8ee..b974bff91 100644 --- a/examples/stm32f0/src/bin/wdg.rs +++ b/examples/stm32f0/src/bin/wdg.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml index f04d41317..c933a4368 100644 --- a/examples/stm32f1/Cargo.toml +++ b/examples/stm32f1/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32f103c8 to your chip name, if necessary. | 8 | # Change stm32f103c8 to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any" ] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any" ] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
diff --git a/examples/stm32f1/src/bin/adc.rs b/examples/stm32f1/src/bin/adc.rs index 1edac3d83..1440460a9 100644 --- a/examples/stm32f1/src/bin/adc.rs +++ b/examples/stm32f1/src/bin/adc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f1/src/bin/blinky.rs b/examples/stm32f1/src/bin/blinky.rs index 3425b0536..cc43f85f4 100644 --- a/examples/stm32f1/src/bin/blinky.rs +++ b/examples/stm32f1/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f1/src/bin/can.rs b/examples/stm32f1/src/bin/can.rs index a5ce819d4..c1c4f8359 100644 --- a/examples/stm32f1/src/bin/can.rs +++ b/examples/stm32f1/src/bin/can.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f1/src/bin/hello.rs b/examples/stm32f1/src/bin/hello.rs index e63bcaae0..7b761ecc1 100644 --- a/examples/stm32f1/src/bin/hello.rs +++ b/examples/stm32f1/src/bin/hello.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f1/src/bin/usb_serial.rs b/examples/stm32f1/src/bin/usb_serial.rs index 31519555f..e28381893 100644 --- a/examples/stm32f1/src/bin/usb_serial.rs +++ b/examples/stm32f1/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml index 66cc1e15b..eaaadeec5 100644 --- a/examples/stm32f2/Cargo.toml +++ b/examples/stm32f2/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32f207zg to your chip name, if necessary. | 8 | # Change stm32f207zg to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | 13 | ||
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
diff --git a/examples/stm32f2/src/bin/blinky.rs b/examples/stm32f2/src/bin/blinky.rs index f6d7a0005..d9833ba8b 100644 --- a/examples/stm32f2/src/bin/blinky.rs +++ b/examples/stm32f2/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f2/src/bin/pll.rs b/examples/stm32f2/src/bin/pll.rs index aae7637dc..e32f283d1 100644 --- a/examples/stm32f2/src/bin/pll.rs +++ b/examples/stm32f2/src/bin/pll.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::convert::TryFrom; | 4 | use core::convert::TryFrom; |
| 6 | 5 | ||
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml index ed1367858..d5ab0b25a 100644 --- a/examples/stm32f3/Cargo.toml +++ b/examples/stm32f3/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32f303ze to your chip name, if necessary. | 8 | # Change stm32f303ze to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| @@ -24,7 +24,7 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa | |||
| 24 | heapless = { version = "0.8", default-features = false } | 24 | heapless = { version = "0.8", default-features = false } |
| 25 | nb = "1.0.0" | 25 | nb = "1.0.0" |
| 26 | embedded-storage = "0.3.1" | 26 | embedded-storage = "0.3.1" |
| 27 | static_cell = { version = "2", features = ["nightly"]} | 27 | static_cell = "2" |
| 28 | 28 | ||
| 29 | [profile.release] | 29 | [profile.release] |
| 30 | debug = 2 | 30 | debug = 2 |
diff --git a/examples/stm32f3/src/bin/blinky.rs b/examples/stm32f3/src/bin/blinky.rs index e71031b30..0ea10522d 100644 --- a/examples/stm32f3/src/bin/blinky.rs +++ b/examples/stm32f3/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f3/src/bin/button.rs b/examples/stm32f3/src/bin/button.rs index 2f47d8f80..2cd356787 100644 --- a/examples/stm32f3/src/bin/button.rs +++ b/examples/stm32f3/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs index 9df6d680d..2f7da4ef5 100644 --- a/examples/stm32f3/src/bin/button_events.rs +++ b/examples/stm32f3/src/bin/button_events.rs | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #![no_std] | 9 | #![no_std] |
| 10 | #![no_main] | 10 | #![no_main] |
| 11 | #![feature(type_alias_impl_trait)] | ||
| 12 | 11 | ||
| 13 | use defmt::*; | 12 | use defmt::*; |
| 14 | use embassy_executor::Spawner; | 13 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f3/src/bin/button_exti.rs b/examples/stm32f3/src/bin/button_exti.rs index 1266778c1..86ff68492 100644 --- a/examples/stm32f3/src/bin/button_exti.rs +++ b/examples/stm32f3/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f3/src/bin/flash.rs b/examples/stm32f3/src/bin/flash.rs index 236fb36c1..28125697d 100644 --- a/examples/stm32f3/src/bin/flash.rs +++ b/examples/stm32f3/src/bin/flash.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f3/src/bin/hello.rs b/examples/stm32f3/src/bin/hello.rs index b3285f3c1..fd54da53d 100644 --- a/examples/stm32f3/src/bin/hello.rs +++ b/examples/stm32f3/src/bin/hello.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f3/src/bin/multiprio.rs b/examples/stm32f3/src/bin/multiprio.rs index 74f3bb1c5..328447210 100644 --- a/examples/stm32f3/src/bin/multiprio.rs +++ b/examples/stm32f3/src/bin/multiprio.rs | |||
| @@ -55,7 +55,6 @@ | |||
| 55 | 55 | ||
| 56 | #![no_std] | 56 | #![no_std] |
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | ||
| 59 | 58 | ||
| 60 | use cortex_m_rt::entry; | 59 | use cortex_m_rt::entry; |
| 61 | use defmt::*; | 60 | use defmt::*; |
diff --git a/examples/stm32f3/src/bin/spi_dma.rs b/examples/stm32f3/src/bin/spi_dma.rs index a27c1d547..54498d53d 100644 --- a/examples/stm32f3/src/bin/spi_dma.rs +++ b/examples/stm32f3/src/bin/spi_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | use core::str::from_utf8; | 5 | use core::str::from_utf8; |
diff --git a/examples/stm32f3/src/bin/usart_dma.rs b/examples/stm32f3/src/bin/usart_dma.rs index ce8c212ae..5234e53b9 100644 --- a/examples/stm32f3/src/bin/usart_dma.rs +++ b/examples/stm32f3/src/bin/usart_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | 5 | ||
diff --git a/examples/stm32f3/src/bin/usb_serial.rs b/examples/stm32f3/src/bin/usb_serial.rs index d5d068d62..cf9ecedfa 100644 --- a/examples/stm32f3/src/bin/usb_serial.rs +++ b/examples/stm32f3/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f334/Cargo.toml b/examples/stm32f334/Cargo.toml index 320cf7d7b..b29a08e7c 100644 --- a/examples/stm32f334/Cargo.toml +++ b/examples/stm32f334/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f334r8", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f334r8", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| @@ -23,4 +23,4 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa | |||
| 23 | heapless = { version = "0.8", default-features = false } | 23 | heapless = { version = "0.8", default-features = false } |
| 24 | nb = "1.0.0" | 24 | nb = "1.0.0" |
| 25 | embedded-storage = "0.3.1" | 25 | embedded-storage = "0.3.1" |
| 26 | static_cell = { version = "2", features = ["nightly"]} | 26 | static_cell = "2" |
diff --git a/examples/stm32f334/src/bin/adc.rs b/examples/stm32f334/src/bin/adc.rs index f259135d2..063ee9dac 100644 --- a/examples/stm32f334/src/bin/adc.rs +++ b/examples/stm32f334/src/bin/adc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f334/src/bin/button.rs b/examples/stm32f334/src/bin/button.rs index 501fb080c..256f9a44a 100644 --- a/examples/stm32f334/src/bin/button.rs +++ b/examples/stm32f334/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f334/src/bin/hello.rs b/examples/stm32f334/src/bin/hello.rs index b3285f3c1..fd54da53d 100644 --- a/examples/stm32f334/src/bin/hello.rs +++ b/examples/stm32f334/src/bin/hello.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f334/src/bin/opamp.rs b/examples/stm32f334/src/bin/opamp.rs index 10e7b3543..850a0e335 100644 --- a/examples/stm32f334/src/bin/opamp.rs +++ b/examples/stm32f334/src/bin/opamp.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f334/src/bin/pwm.rs b/examples/stm32f334/src/bin/pwm.rs index 8040c3f18..c149cad92 100644 --- a/examples/stm32f334/src/bin/pwm.rs +++ b/examples/stm32f334/src/bin/pwm.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml index 6ea0018cd..a74e0f674 100644 --- a/examples/stm32f4/Cargo.toml +++ b/examples/stm32f4/Cargo.toml | |||
| @@ -6,9 +6,9 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | # Change stm32f429zi to your chip name, if necessary. | 8 | # Change stm32f429zi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "chrono"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt" ] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt" ] } |
| 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", ] } | 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", ] } |
| @@ -27,7 +27,7 @@ heapless = { version = "0.8", default-features = false } | |||
| 27 | nb = "1.0.0" | 27 | nb = "1.0.0" |
| 28 | embedded-storage = "0.3.1" | 28 | embedded-storage = "0.3.1" |
| 29 | micromath = "2.0.0" | 29 | micromath = "2.0.0" |
| 30 | static_cell = { version = "2", features = ["nightly"]} | 30 | static_cell = "2" |
| 31 | chrono = { version = "^0.4", default-features = false} | 31 | chrono = { version = "^0.4", default-features = false} |
| 32 | 32 | ||
| 33 | [profile.release] | 33 | [profile.release] |
diff --git a/examples/stm32f4/src/bin/adc.rs b/examples/stm32f4/src/bin/adc.rs index f19328727..699c29c05 100644 --- a/examples/stm32f4/src/bin/adc.rs +++ b/examples/stm32f4/src/bin/adc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m::prelude::_embedded_hal_blocking_delay_DelayUs; | 4 | use cortex_m::prelude::_embedded_hal_blocking_delay_DelayUs; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32f4/src/bin/blinky.rs b/examples/stm32f4/src/bin/blinky.rs index 4bfc5a50d..31cce8225 100644 --- a/examples/stm32f4/src/bin/blinky.rs +++ b/examples/stm32f4/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/button.rs b/examples/stm32f4/src/bin/button.rs index aa1eed46f..ad30a56a2 100644 --- a/examples/stm32f4/src/bin/button.rs +++ b/examples/stm32f4/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32f4/src/bin/button_exti.rs b/examples/stm32f4/src/bin/button_exti.rs index dfe587d41..67751187d 100644 --- a/examples/stm32f4/src/bin/button_exti.rs +++ b/examples/stm32f4/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/can.rs b/examples/stm32f4/src/bin/can.rs index 20ce4edce..d074b4265 100644 --- a/examples/stm32f4/src/bin/can.rs +++ b/examples/stm32f4/src/bin/can.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/dac.rs b/examples/stm32f4/src/bin/dac.rs index 8f14d6078..9c7754c4f 100644 --- a/examples/stm32f4/src/bin/dac.rs +++ b/examples/stm32f4/src/bin/dac.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/eth.rs b/examples/stm32f4/src/bin/eth.rs index 088d83c06..7f5c8fdb1 100644 --- a/examples/stm32f4/src/bin/eth.rs +++ b/examples/stm32f4/src/bin/eth.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -14,7 +13,7 @@ use embassy_stm32::time::Hertz; | |||
| 14 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 13 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; |
| 15 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
| 16 | use embedded_io_async::Write; | 15 | use embedded_io_async::Write; |
| 17 | use static_cell::make_static; | 16 | use static_cell::StaticCell; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | 18 | ||
| 20 | bind_interrupts!(struct Irqs { | 19 | bind_interrupts!(struct Irqs { |
| @@ -63,8 +62,9 @@ async fn main(spawner: Spawner) -> ! { | |||
| 63 | 62 | ||
| 64 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 63 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 65 | 64 | ||
| 65 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); | ||
| 66 | let device = Ethernet::new( | 66 | let device = Ethernet::new( |
| 67 | make_static!(PacketQueue::<16, 16>::new()), | 67 | PACKETS.init(PacketQueue::<16, 16>::new()), |
| 68 | p.ETH, | 68 | p.ETH, |
| 69 | Irqs, | 69 | Irqs, |
| 70 | p.PA1, | 70 | p.PA1, |
| @@ -88,11 +88,13 @@ async fn main(spawner: Spawner) -> ! { | |||
| 88 | //}); | 88 | //}); |
| 89 | 89 | ||
| 90 | // Init network stack | 90 | // Init network stack |
| 91 | let stack = &*make_static!(Stack::new( | 91 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 92 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 93 | let stack = &*STACK.init(Stack::new( | ||
| 92 | device, | 94 | device, |
| 93 | config, | 95 | config, |
| 94 | make_static!(StackResources::<2>::new()), | 96 | RESOURCES.init(StackResources::<2>::new()), |
| 95 | seed | 97 | seed, |
| 96 | )); | 98 | )); |
| 97 | 99 | ||
| 98 | // Launch network task | 100 | // Launch network task |
diff --git a/examples/stm32f4/src/bin/flash.rs b/examples/stm32f4/src/bin/flash.rs index 93c54e943..1e8cabab4 100644 --- a/examples/stm32f4/src/bin/flash.rs +++ b/examples/stm32f4/src/bin/flash.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -31,7 +30,7 @@ fn test_flash(f: &mut Flash<'_, Blocking>, offset: u32, size: u32) { | |||
| 31 | 30 | ||
| 32 | info!("Reading..."); | 31 | info!("Reading..."); |
| 33 | let mut buf = [0u8; 32]; | 32 | let mut buf = [0u8; 32]; |
| 34 | unwrap!(f.read(offset, &mut buf)); | 33 | unwrap!(f.blocking_read(offset, &mut buf)); |
| 35 | info!("Read: {=[u8]:x}", buf); | 34 | info!("Read: {=[u8]:x}", buf); |
| 36 | 35 | ||
| 37 | info!("Erasing..."); | 36 | info!("Erasing..."); |
| @@ -39,7 +38,7 @@ fn test_flash(f: &mut Flash<'_, Blocking>, offset: u32, size: u32) { | |||
| 39 | 38 | ||
| 40 | info!("Reading..."); | 39 | info!("Reading..."); |
| 41 | let mut buf = [0u8; 32]; | 40 | let mut buf = [0u8; 32]; |
| 42 | unwrap!(f.read(offset, &mut buf)); | 41 | unwrap!(f.blocking_read(offset, &mut buf)); |
| 43 | info!("Read after erase: {=[u8]:x}", buf); | 42 | info!("Read after erase: {=[u8]:x}", buf); |
| 44 | 43 | ||
| 45 | info!("Writing..."); | 44 | info!("Writing..."); |
| @@ -53,7 +52,7 @@ fn test_flash(f: &mut Flash<'_, Blocking>, offset: u32, size: u32) { | |||
| 53 | 52 | ||
| 54 | info!("Reading..."); | 53 | info!("Reading..."); |
| 55 | let mut buf = [0u8; 32]; | 54 | let mut buf = [0u8; 32]; |
| 56 | unwrap!(f.read(offset, &mut buf)); | 55 | unwrap!(f.blocking_read(offset, &mut buf)); |
| 57 | info!("Read: {=[u8]:x}", buf); | 56 | info!("Read: {=[u8]:x}", buf); |
| 58 | assert_eq!( | 57 | assert_eq!( |
| 59 | &buf[..], | 58 | &buf[..], |
diff --git a/examples/stm32f4/src/bin/flash_async.rs b/examples/stm32f4/src/bin/flash_async.rs index f0a65a725..493a536f3 100644 --- a/examples/stm32f4/src/bin/flash_async.rs +++ b/examples/stm32f4/src/bin/flash_async.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -48,7 +47,7 @@ async fn test_flash<'a>(f: &mut Flash<'a>, offset: u32, size: u32) { | |||
| 48 | 47 | ||
| 49 | info!("Reading..."); | 48 | info!("Reading..."); |
| 50 | let mut buf = [0u8; 32]; | 49 | let mut buf = [0u8; 32]; |
| 51 | unwrap!(f.read(offset, &mut buf)); | 50 | unwrap!(f.blocking_read(offset, &mut buf)); |
| 52 | info!("Read: {=[u8]:x}", buf); | 51 | info!("Read: {=[u8]:x}", buf); |
| 53 | 52 | ||
| 54 | info!("Erasing..."); | 53 | info!("Erasing..."); |
| @@ -56,7 +55,7 @@ async fn test_flash<'a>(f: &mut Flash<'a>, offset: u32, size: u32) { | |||
| 56 | 55 | ||
| 57 | info!("Reading..."); | 56 | info!("Reading..."); |
| 58 | let mut buf = [0u8; 32]; | 57 | let mut buf = [0u8; 32]; |
| 59 | unwrap!(f.read(offset, &mut buf)); | 58 | unwrap!(f.blocking_read(offset, &mut buf)); |
| 60 | info!("Read after erase: {=[u8]:x}", buf); | 59 | info!("Read after erase: {=[u8]:x}", buf); |
| 61 | 60 | ||
| 62 | info!("Writing..."); | 61 | info!("Writing..."); |
| @@ -73,7 +72,7 @@ async fn test_flash<'a>(f: &mut Flash<'a>, offset: u32, size: u32) { | |||
| 73 | 72 | ||
| 74 | info!("Reading..."); | 73 | info!("Reading..."); |
| 75 | let mut buf = [0u8; 32]; | 74 | let mut buf = [0u8; 32]; |
| 76 | unwrap!(f.read(offset, &mut buf)); | 75 | unwrap!(f.blocking_read(offset, &mut buf)); |
| 77 | info!("Read: {=[u8]:x}", buf); | 76 | info!("Read: {=[u8]:x}", buf); |
| 78 | assert_eq!( | 77 | assert_eq!( |
| 79 | &buf[..], | 78 | &buf[..], |
diff --git a/examples/stm32f4/src/bin/hello.rs b/examples/stm32f4/src/bin/hello.rs index a2a287110..3c295612c 100644 --- a/examples/stm32f4/src/bin/hello.rs +++ b/examples/stm32f4/src/bin/hello.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/i2c.rs b/examples/stm32f4/src/bin/i2c.rs index 4f4adde28..4b5da774d 100644 --- a/examples/stm32f4/src/bin/i2c.rs +++ b/examples/stm32f4/src/bin/i2c.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/i2c_async.rs b/examples/stm32f4/src/bin/i2c_async.rs index 9f59e4d41..90d11d4b4 100644 --- a/examples/stm32f4/src/bin/i2c_async.rs +++ b/examples/stm32f4/src/bin/i2c_async.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | // Example originally designed for stm32f411ceu6 reading an A1454 hall effect sensor on I2C1 | 4 | // Example originally designed for stm32f411ceu6 reading an A1454 hall effect sensor on I2C1 |
| 6 | // DMA peripherals changed to compile for stm32f429zi, for the CI. | 5 | // DMA peripherals changed to compile for stm32f429zi, for the CI. |
diff --git a/examples/stm32f4/src/bin/i2c_comparison.rs b/examples/stm32f4/src/bin/i2c_comparison.rs index 6d23c0ed8..30cfbdf57 100644 --- a/examples/stm32f4/src/bin/i2c_comparison.rs +++ b/examples/stm32f4/src/bin/i2c_comparison.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | // Example originally designed for stm32f411ceu6 with three A1454 hall effect sensors, connected to I2C1, 2 and 3 | 4 | // Example originally designed for stm32f411ceu6 with three A1454 hall effect sensors, connected to I2C1, 2 and 3 |
| 6 | // on the pins referenced in the peripheral definitions. | 5 | // on the pins referenced in the peripheral definitions. |
diff --git a/examples/stm32f4/src/bin/i2s_dma.rs b/examples/stm32f4/src/bin/i2s_dma.rs index e8d7b5f77..97a04b2aa 100644 --- a/examples/stm32f4/src/bin/i2s_dma.rs +++ b/examples/stm32f4/src/bin/i2s_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | 5 | ||
diff --git a/examples/stm32f4/src/bin/mco.rs b/examples/stm32f4/src/bin/mco.rs index 3315e7652..eb7bb6261 100644 --- a/examples/stm32f4/src/bin/mco.rs +++ b/examples/stm32f4/src/bin/mco.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/multiprio.rs b/examples/stm32f4/src/bin/multiprio.rs index 74f3bb1c5..328447210 100644 --- a/examples/stm32f4/src/bin/multiprio.rs +++ b/examples/stm32f4/src/bin/multiprio.rs | |||
| @@ -55,7 +55,6 @@ | |||
| 55 | 55 | ||
| 56 | #![no_std] | 56 | #![no_std] |
| 57 | #![no_main] | 57 | #![no_main] |
| 58 | #![feature(type_alias_impl_trait)] | ||
| 59 | 58 | ||
| 60 | use cortex_m_rt::entry; | 59 | use cortex_m_rt::entry; |
| 61 | use defmt::*; | 60 | use defmt::*; |
diff --git a/examples/stm32f4/src/bin/pwm.rs b/examples/stm32f4/src/bin/pwm.rs index 8e41d0e78..8844a9f0e 100644 --- a/examples/stm32f4/src/bin/pwm.rs +++ b/examples/stm32f4/src/bin/pwm.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/pwm_complementary.rs b/examples/stm32f4/src/bin/pwm_complementary.rs index d925f26d9..161f43c48 100644 --- a/examples/stm32f4/src/bin/pwm_complementary.rs +++ b/examples/stm32f4/src/bin/pwm_complementary.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/rtc.rs b/examples/stm32f4/src/bin/rtc.rs index 44b4303c0..abab07b6b 100644 --- a/examples/stm32f4/src/bin/rtc.rs +++ b/examples/stm32f4/src/bin/rtc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32f4/src/bin/sdmmc.rs b/examples/stm32f4/src/bin/sdmmc.rs index 91747b2d5..66e4e527c 100644 --- a/examples/stm32f4/src/bin/sdmmc.rs +++ b/examples/stm32f4/src/bin/sdmmc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/spi.rs b/examples/stm32f4/src/bin/spi.rs index 0919e9874..dc9141c62 100644 --- a/examples/stm32f4/src/bin/spi.rs +++ b/examples/stm32f4/src/bin/spi.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32f4/src/bin/spi_dma.rs b/examples/stm32f4/src/bin/spi_dma.rs index f291f7dba..7249c831a 100644 --- a/examples/stm32f4/src/bin/spi_dma.rs +++ b/examples/stm32f4/src/bin/spi_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | use core::str::from_utf8; | 5 | use core::str::from_utf8; |
diff --git a/examples/stm32f4/src/bin/usart.rs b/examples/stm32f4/src/bin/usart.rs index 45e94715f..40d9d70f1 100644 --- a/examples/stm32f4/src/bin/usart.rs +++ b/examples/stm32f4/src/bin/usart.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32f4/src/bin/usart_buffered.rs b/examples/stm32f4/src/bin/usart_buffered.rs index 71abc2893..c99807f11 100644 --- a/examples/stm32f4/src/bin/usart_buffered.rs +++ b/examples/stm32f4/src/bin/usart_buffered.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/usart_dma.rs b/examples/stm32f4/src/bin/usart_dma.rs index dca25a78c..dd6de599c 100644 --- a/examples/stm32f4/src/bin/usart_dma.rs +++ b/examples/stm32f4/src/bin/usart_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | 5 | ||
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs index 6bf5b1cba..a196259a8 100644 --- a/examples/stm32f4/src/bin/usb_ethernet.rs +++ b/examples/stm32f4/src/bin/usb_ethernet.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -14,7 +13,7 @@ use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState | |||
| 14 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; | 13 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; |
| 15 | use embassy_usb::{Builder, UsbDevice}; | 14 | use embassy_usb::{Builder, UsbDevice}; |
| 16 | use embedded_io_async::Write; | 15 | use embedded_io_async::Write; |
| 17 | use static_cell::make_static; | 16 | use static_cell::StaticCell; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | 18 | ||
| 20 | type UsbDriver = Driver<'static, embassy_stm32::peripherals::USB_OTG_FS>; | 19 | type UsbDriver = Driver<'static, embassy_stm32::peripherals::USB_OTG_FS>; |
| @@ -68,7 +67,8 @@ async fn main(spawner: Spawner) { | |||
| 68 | let p = embassy_stm32::init(config); | 67 | let p = embassy_stm32::init(config); |
| 69 | 68 | ||
| 70 | // Create the driver, from the HAL. | 69 | // Create the driver, from the HAL. |
| 71 | let ep_out_buffer = &mut make_static!([0; 256])[..]; | 70 | static OUTPUT_BUFFER: StaticCell<[u8; 256]> = StaticCell::new(); |
| 71 | let ep_out_buffer = &mut OUTPUT_BUFFER.init([0; 256])[..]; | ||
| 72 | let mut config = embassy_stm32::usb_otg::Config::default(); | 72 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 73 | config.vbus_detection = true; | 73 | config.vbus_detection = true; |
| 74 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, ep_out_buffer, config); | 74 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, ep_out_buffer, config); |
| @@ -88,14 +88,18 @@ async fn main(spawner: Spawner) { | |||
| 88 | config.device_protocol = 0x01; | 88 | config.device_protocol = 0x01; |
| 89 | 89 | ||
| 90 | // Create embassy-usb DeviceBuilder using the driver and config. | 90 | // Create embassy-usb DeviceBuilder using the driver and config. |
| 91 | static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 92 | static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 93 | static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 94 | static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new(); | ||
| 91 | let mut builder = Builder::new( | 95 | let mut builder = Builder::new( |
| 92 | driver, | 96 | driver, |
| 93 | config, | 97 | config, |
| 94 | &mut make_static!([0; 256])[..], | 98 | &mut DEVICE_DESC.init([0; 256])[..], |
| 95 | &mut make_static!([0; 256])[..], | 99 | &mut CONFIG_DESC.init([0; 256])[..], |
| 96 | &mut make_static!([0; 256])[..], | 100 | &mut BOS_DESC.init([0; 256])[..], |
| 97 | &mut [], // no msos descriptors | 101 | &mut [], // no msos descriptors |
| 98 | &mut make_static!([0; 128])[..], | 102 | &mut CONTROL_BUF.init([0; 128])[..], |
| 99 | ); | 103 | ); |
| 100 | 104 | ||
| 101 | // Our MAC addr. | 105 | // Our MAC addr. |
| @@ -104,14 +108,16 @@ async fn main(spawner: Spawner) { | |||
| 104 | let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; | 108 | let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; |
| 105 | 109 | ||
| 106 | // Create classes on the builder. | 110 | // Create classes on the builder. |
| 107 | let class = CdcNcmClass::new(&mut builder, make_static!(State::new()), host_mac_addr, 64); | 111 | static STATE: StaticCell<State> = StaticCell::new(); |
| 112 | let class = CdcNcmClass::new(&mut builder, STATE.init(State::new()), host_mac_addr, 64); | ||
| 108 | 113 | ||
| 109 | // Build the builder. | 114 | // Build the builder. |
| 110 | let usb = builder.build(); | 115 | let usb = builder.build(); |
| 111 | 116 | ||
| 112 | unwrap!(spawner.spawn(usb_task(usb))); | 117 | unwrap!(spawner.spawn(usb_task(usb))); |
| 113 | 118 | ||
| 114 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); | 119 | static NET_STATE: StaticCell<NetState<MTU, 4, 4>> = StaticCell::new(); |
| 120 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(NET_STATE.init(NetState::new()), our_mac_addr); | ||
| 115 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 121 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 116 | 122 | ||
| 117 | let config = embassy_net::Config::dhcpv4(Default::default()); | 123 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| @@ -128,11 +134,13 @@ async fn main(spawner: Spawner) { | |||
| 128 | let seed = u64::from_le_bytes(seed); | 134 | let seed = u64::from_le_bytes(seed); |
| 129 | 135 | ||
| 130 | // Init network stack | 136 | // Init network stack |
| 131 | let stack = &*make_static!(Stack::new( | 137 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); |
| 138 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 139 | let stack = &*STACK.init(Stack::new( | ||
| 132 | device, | 140 | device, |
| 133 | config, | 141 | config, |
| 134 | make_static!(StackResources::<2>::new()), | 142 | RESOURCES.init(StackResources::<2>::new()), |
| 135 | seed | 143 | seed, |
| 136 | )); | 144 | )); |
| 137 | 145 | ||
| 138 | unwrap!(spawner.spawn(net_task(stack))); | 146 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/stm32f4/src/bin/usb_raw.rs b/examples/stm32f4/src/bin/usb_raw.rs index 719b22bb9..afff55187 100644 --- a/examples/stm32f4/src/bin/usb_raw.rs +++ b/examples/stm32f4/src/bin/usb_raw.rs | |||
| @@ -48,7 +48,6 @@ | |||
| 48 | 48 | ||
| 49 | #![no_std] | 49 | #![no_std] |
| 50 | #![no_main] | 50 | #![no_main] |
| 51 | #![feature(type_alias_impl_trait)] | ||
| 52 | 51 | ||
| 53 | use defmt::*; | 52 | use defmt::*; |
| 54 | use embassy_executor::Spawner; | 53 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/usb_serial.rs b/examples/stm32f4/src/bin/usb_serial.rs index e2ccc9142..58d994a61 100644 --- a/examples/stm32f4/src/bin/usb_serial.rs +++ b/examples/stm32f4/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/wdt.rs b/examples/stm32f4/src/bin/wdt.rs index 0443b61c5..ea27ebce0 100644 --- a/examples/stm32f4/src/bin/wdt.rs +++ b/examples/stm32f4/src/bin/wdt.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f4/src/bin/ws2812_pwm_dma.rs b/examples/stm32f4/src/bin/ws2812_pwm_dma.rs index dccd639ac..dc397eff1 100644 --- a/examples/stm32f4/src/bin/ws2812_pwm_dma.rs +++ b/examples/stm32f4/src/bin/ws2812_pwm_dma.rs | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | 17 | ||
| 18 | #![no_std] | 18 | #![no_std] |
| 19 | #![no_main] | 19 | #![no_main] |
| 20 | #![feature(type_alias_impl_trait)] | ||
| 21 | 20 | ||
| 22 | use embassy_executor::Spawner; | 21 | use embassy_executor::Spawner; |
| 23 | use embassy_stm32::gpio::OutputType; | 22 | use embassy_stm32::gpio::OutputType; |
| @@ -118,7 +117,7 @@ async fn main(_spawner: Spawner) { | |||
| 118 | &mut dp.DMA1_CH2, | 117 | &mut dp.DMA1_CH2, |
| 119 | 5, | 118 | 5, |
| 120 | color, | 119 | color, |
| 121 | pac::TIM3.ccr(pwm_channel.raw()).as_ptr() as *mut _, | 120 | pac::TIM3.ccr(pwm_channel.index()).as_ptr() as *mut _, |
| 122 | dma_transfer_option, | 121 | dma_transfer_option, |
| 123 | ) | 122 | ) |
| 124 | .await; | 123 | .await; |
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml index 4cca0d93c..b76a848a8 100644 --- a/examples/stm32f7/Cargo.toml +++ b/examples/stm32f7/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32f767zi to your chip name, if necessary. | 8 | # Change stm32f767zi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } | 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } |
| 14 | embedded-io-async = { version = "0.6.1" } | 14 | embedded-io-async = { version = "0.6.1" } |
| @@ -27,7 +27,7 @@ nb = "1.0.0" | |||
| 27 | rand_core = "0.6.3" | 27 | rand_core = "0.6.3" |
| 28 | critical-section = "1.1" | 28 | critical-section = "1.1" |
| 29 | embedded-storage = "0.3.1" | 29 | embedded-storage = "0.3.1" |
| 30 | static_cell = { version = "2", features = ["nightly"]} | 30 | static_cell = "2" |
| 31 | 31 | ||
| 32 | [profile.release] | 32 | [profile.release] |
| 33 | debug = 2 | 33 | debug = 2 |
diff --git a/examples/stm32f7/src/bin/adc.rs b/examples/stm32f7/src/bin/adc.rs index 48c59eaf0..f8d7b691f 100644 --- a/examples/stm32f7/src/bin/adc.rs +++ b/examples/stm32f7/src/bin/adc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f7/src/bin/blinky.rs b/examples/stm32f7/src/bin/blinky.rs index 4bfc5a50d..31cce8225 100644 --- a/examples/stm32f7/src/bin/blinky.rs +++ b/examples/stm32f7/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f7/src/bin/button.rs b/examples/stm32f7/src/bin/button.rs index aa1eed46f..ad30a56a2 100644 --- a/examples/stm32f7/src/bin/button.rs +++ b/examples/stm32f7/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32f7/src/bin/button_exti.rs b/examples/stm32f7/src/bin/button_exti.rs index dfe587d41..67751187d 100644 --- a/examples/stm32f7/src/bin/button_exti.rs +++ b/examples/stm32f7/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f7/src/bin/can.rs b/examples/stm32f7/src/bin/can.rs index 78b21ceaa..bcfdb67a8 100644 --- a/examples/stm32f7/src/bin/can.rs +++ b/examples/stm32f7/src/bin/can.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -12,6 +11,7 @@ use embassy_stm32::can::{ | |||
| 12 | }; | 11 | }; |
| 13 | use embassy_stm32::gpio::{Input, Pull}; | 12 | use embassy_stm32::gpio::{Input, Pull}; |
| 14 | use embassy_stm32::peripherals::CAN3; | 13 | use embassy_stm32::peripherals::CAN3; |
| 14 | use static_cell::StaticCell; | ||
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
| 17 | bind_interrupts!(struct Irqs { | 17 | bind_interrupts!(struct Irqs { |
| @@ -43,7 +43,8 @@ async fn main(spawner: Spawner) { | |||
| 43 | let rx_pin = Input::new(&mut p.PA15, Pull::Up); | 43 | let rx_pin = Input::new(&mut p.PA15, Pull::Up); |
| 44 | core::mem::forget(rx_pin); | 44 | core::mem::forget(rx_pin); |
| 45 | 45 | ||
| 46 | let can: &'static mut Can<'static, CAN3> = static_cell::make_static!(Can::new(p.CAN3, p.PA8, p.PA15, Irqs)); | 46 | static CAN: StaticCell<Can<'static, CAN3>> = StaticCell::new(); |
| 47 | let can = CAN.init(Can::new(p.CAN3, p.PA8, p.PA15, Irqs)); | ||
| 47 | can.as_mut() | 48 | can.as_mut() |
| 48 | .modify_filters() | 49 | .modify_filters() |
| 49 | .enable_bank(0, Fifo::Fifo0, Mask32::accept_all()); | 50 | .enable_bank(0, Fifo::Fifo0, Mask32::accept_all()); |
| @@ -56,7 +57,8 @@ async fn main(spawner: Spawner) { | |||
| 56 | 57 | ||
| 57 | let (tx, mut rx) = can.split(); | 58 | let (tx, mut rx) = can.split(); |
| 58 | 59 | ||
| 59 | let tx: &'static mut CanTx<'static, 'static, CAN3> = static_cell::make_static!(tx); | 60 | static CAN_TX: StaticCell<CanTx<'static, 'static, CAN3>> = StaticCell::new(); |
| 61 | let tx = CAN_TX.init(tx); | ||
| 60 | spawner.spawn(send_can_message(tx)).unwrap(); | 62 | spawner.spawn(send_can_message(tx)).unwrap(); |
| 61 | 63 | ||
| 62 | loop { | 64 | loop { |
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index dd0069447..5bff48197 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -15,7 +14,7 @@ use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | |||
| 15 | use embassy_time::Timer; | 14 | use embassy_time::Timer; |
| 16 | use embedded_io_async::Write; | 15 | use embedded_io_async::Write; |
| 17 | use rand_core::RngCore; | 16 | use rand_core::RngCore; |
| 18 | use static_cell::make_static; | 17 | use static_cell::StaticCell; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | 19 | ||
| 21 | bind_interrupts!(struct Irqs { | 20 | bind_interrupts!(struct Irqs { |
| @@ -64,8 +63,9 @@ async fn main(spawner: Spawner) -> ! { | |||
| 64 | 63 | ||
| 65 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 64 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 66 | 65 | ||
| 66 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); | ||
| 67 | let device = Ethernet::new( | 67 | let device = Ethernet::new( |
| 68 | make_static!(PacketQueue::<16, 16>::new()), | 68 | PACKETS.init(PacketQueue::<16, 16>::new()), |
| 69 | p.ETH, | 69 | p.ETH, |
| 70 | Irqs, | 70 | Irqs, |
| 71 | p.PA1, | 71 | p.PA1, |
| @@ -89,11 +89,13 @@ async fn main(spawner: Spawner) -> ! { | |||
| 89 | //}); | 89 | //}); |
| 90 | 90 | ||
| 91 | // Init network stack | 91 | // Init network stack |
| 92 | let stack = &*make_static!(Stack::new( | 92 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 93 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 94 | let stack = &*STACK.init(Stack::new( | ||
| 93 | device, | 95 | device, |
| 94 | config, | 96 | config, |
| 95 | make_static!(StackResources::<2>::new()), | 97 | RESOURCES.init(StackResources::<2>::new()), |
| 96 | seed | 98 | seed, |
| 97 | )); | 99 | )); |
| 98 | 100 | ||
| 99 | // Launch network task | 101 | // Launch network task |
diff --git a/examples/stm32f7/src/bin/flash.rs b/examples/stm32f7/src/bin/flash.rs index 06a94f1c8..885570478 100644 --- a/examples/stm32f7/src/bin/flash.rs +++ b/examples/stm32f7/src/bin/flash.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f7/src/bin/hello.rs b/examples/stm32f7/src/bin/hello.rs index a2a287110..3c295612c 100644 --- a/examples/stm32f7/src/bin/hello.rs +++ b/examples/stm32f7/src/bin/hello.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::info; | 4 | use defmt::info; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f7/src/bin/sdmmc.rs b/examples/stm32f7/src/bin/sdmmc.rs index 990de0ab1..6d36ef518 100644 --- a/examples/stm32f7/src/bin/sdmmc.rs +++ b/examples/stm32f7/src/bin/sdmmc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32f7/src/bin/usart_dma.rs b/examples/stm32f7/src/bin/usart_dma.rs index ba064081e..fb604b34f 100644 --- a/examples/stm32f7/src/bin/usart_dma.rs +++ b/examples/stm32f7/src/bin/usart_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | 5 | ||
diff --git a/examples/stm32f7/src/bin/usb_serial.rs b/examples/stm32f7/src/bin/usb_serial.rs index 4991edbf0..97daf6bd1 100644 --- a/examples/stm32f7/src/bin/usb_serial.rs +++ b/examples/stm32f7/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml index b1e749440..0abc0a638 100644 --- a/examples/stm32g0/Cargo.toml +++ b/examples/stm32g0/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32g071rb to your chip name, if necessary. | 8 | # Change stm32g071rb to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | 13 | ||
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
diff --git a/examples/stm32g0/src/bin/blinky.rs b/examples/stm32g0/src/bin/blinky.rs index 4bfc5a50d..31cce8225 100644 --- a/examples/stm32g0/src/bin/blinky.rs +++ b/examples/stm32g0/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g0/src/bin/button.rs b/examples/stm32g0/src/bin/button.rs index 40c58013b..265200132 100644 --- a/examples/stm32g0/src/bin/button.rs +++ b/examples/stm32g0/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32g0/src/bin/button_exti.rs b/examples/stm32g0/src/bin/button_exti.rs index ef32d4c4a..1e970fdd6 100644 --- a/examples/stm32g0/src/bin/button_exti.rs +++ b/examples/stm32g0/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g0/src/bin/flash.rs b/examples/stm32g0/src/bin/flash.rs index ed9f2e843..acef87b92 100644 --- a/examples/stm32g0/src/bin/flash.rs +++ b/examples/stm32g0/src/bin/flash.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g0/src/bin/spi_neopixel.rs b/examples/stm32g0/src/bin/spi_neopixel.rs index 214462d0e..c5ea51721 100644 --- a/examples/stm32g0/src/bin/spi_neopixel.rs +++ b/examples/stm32g0/src/bin/spi_neopixel.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml index c56a63623..987f23b3a 100644 --- a/examples/stm32g4/Cargo.toml +++ b/examples/stm32g4/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32g491re to your chip name, if necessary. | 8 | # Change stm32g491re to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
diff --git a/examples/stm32g4/src/bin/adc.rs b/examples/stm32g4/src/bin/adc.rs index 63b20c0d4..35324d931 100644 --- a/examples/stm32g4/src/bin/adc.rs +++ b/examples/stm32g4/src/bin/adc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g4/src/bin/blinky.rs b/examples/stm32g4/src/bin/blinky.rs index cbeb0dee1..90e479aae 100644 --- a/examples/stm32g4/src/bin/blinky.rs +++ b/examples/stm32g4/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g4/src/bin/button.rs b/examples/stm32g4/src/bin/button.rs index 127efb08a..6f3db0819 100644 --- a/examples/stm32g4/src/bin/button.rs +++ b/examples/stm32g4/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32g4/src/bin/button_exti.rs b/examples/stm32g4/src/bin/button_exti.rs index dfe587d41..67751187d 100644 --- a/examples/stm32g4/src/bin/button_exti.rs +++ b/examples/stm32g4/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g4/src/bin/pll.rs b/examples/stm32g4/src/bin/pll.rs index 09ef59d44..46ebe0b0d 100644 --- a/examples/stm32g4/src/bin/pll.rs +++ b/examples/stm32g4/src/bin/pll.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g4/src/bin/pwm.rs b/examples/stm32g4/src/bin/pwm.rs index a84394005..d4809a481 100644 --- a/examples/stm32g4/src/bin/pwm.rs +++ b/examples/stm32g4/src/bin/pwm.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32g4/src/bin/usb_serial.rs b/examples/stm32g4/src/bin/usb_serial.rs index 565b25d60..c26fa76b7 100644 --- a/examples/stm32g4/src/bin/usb_serial.rs +++ b/examples/stm32g4/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h5/Cargo.toml b/examples/stm32h5/Cargo.toml index f714a3984..8815b8e47 100644 --- a/examples/stm32h5/Cargo.toml +++ b/examples/stm32h5/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32h563zi to your chip name, if necessary. | 8 | # Change stm32h563zi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } | 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| @@ -31,7 +31,7 @@ critical-section = "1.1" | |||
| 31 | micromath = "2.0.0" | 31 | micromath = "2.0.0" |
| 32 | stm32-fmc = "0.3.0" | 32 | stm32-fmc = "0.3.0" |
| 33 | embedded-storage = "0.3.1" | 33 | embedded-storage = "0.3.1" |
| 34 | static_cell = { version = "2", features = ["nightly"]} | 34 | static_cell = "2" |
| 35 | 35 | ||
| 36 | # cargo build/run | 36 | # cargo build/run |
| 37 | [profile.dev] | 37 | [profile.dev] |
diff --git a/examples/stm32h5/src/bin/blinky.rs b/examples/stm32h5/src/bin/blinky.rs index 1394f03fa..f37e8b1d8 100644 --- a/examples/stm32h5/src/bin/blinky.rs +++ b/examples/stm32h5/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h5/src/bin/button_exti.rs b/examples/stm32h5/src/bin/button_exti.rs index dfe587d41..67751187d 100644 --- a/examples/stm32h5/src/bin/button_exti.rs +++ b/examples/stm32h5/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs index b2758cba0..2370656e6 100644 --- a/examples/stm32h5/src/bin/eth.rs +++ b/examples/stm32h5/src/bin/eth.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -18,7 +17,7 @@ use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | |||
| 18 | use embassy_time::Timer; | 17 | use embassy_time::Timer; |
| 19 | use embedded_io_async::Write; | 18 | use embedded_io_async::Write; |
| 20 | use rand_core::RngCore; | 19 | use rand_core::RngCore; |
| 21 | use static_cell::make_static; | 20 | use static_cell::StaticCell; |
| 22 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 23 | 22 | ||
| 24 | bind_interrupts!(struct Irqs { | 23 | bind_interrupts!(struct Irqs { |
| @@ -67,8 +66,9 @@ async fn main(spawner: Spawner) -> ! { | |||
| 67 | 66 | ||
| 68 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 67 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 69 | 68 | ||
| 69 | static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new(); | ||
| 70 | let device = Ethernet::new( | 70 | let device = Ethernet::new( |
| 71 | make_static!(PacketQueue::<4, 4>::new()), | 71 | PACKETS.init(PacketQueue::<4, 4>::new()), |
| 72 | p.ETH, | 72 | p.ETH, |
| 73 | Irqs, | 73 | Irqs, |
| 74 | p.PA1, | 74 | p.PA1, |
| @@ -92,11 +92,13 @@ async fn main(spawner: Spawner) -> ! { | |||
| 92 | //}); | 92 | //}); |
| 93 | 93 | ||
| 94 | // Init network stack | 94 | // Init network stack |
| 95 | let stack = &*make_static!(Stack::new( | 95 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 96 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 97 | let stack = &*STACK.init(Stack::new( | ||
| 96 | device, | 98 | device, |
| 97 | config, | 99 | config, |
| 98 | make_static!(StackResources::<2>::new()), | 100 | RESOURCES.init(StackResources::<2>::new()), |
| 99 | seed | 101 | seed, |
| 100 | )); | 102 | )); |
| 101 | 103 | ||
| 102 | // Launch network task | 104 | // Launch network task |
diff --git a/examples/stm32h5/src/bin/i2c.rs b/examples/stm32h5/src/bin/i2c.rs index 31783a2bf..31e83cbb5 100644 --- a/examples/stm32h5/src/bin/i2c.rs +++ b/examples/stm32h5/src/bin/i2c.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h5/src/bin/rng.rs b/examples/stm32h5/src/bin/rng.rs index 7c8c50eca..9c0d704b5 100644 --- a/examples/stm32h5/src/bin/rng.rs +++ b/examples/stm32h5/src/bin/rng.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h5/src/bin/usart.rs b/examples/stm32h5/src/bin/usart.rs index db04d4e55..f9cbad6af 100644 --- a/examples/stm32h5/src/bin/usart.rs +++ b/examples/stm32h5/src/bin/usart.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32h5/src/bin/usart_dma.rs b/examples/stm32h5/src/bin/usart_dma.rs index bafe50839..caae0dd18 100644 --- a/examples/stm32h5/src/bin/usart_dma.rs +++ b/examples/stm32h5/src/bin/usart_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | 5 | ||
diff --git a/examples/stm32h5/src/bin/usart_split.rs b/examples/stm32h5/src/bin/usart_split.rs index d9037c014..92047de8d 100644 --- a/examples/stm32h5/src/bin/usart_split.rs +++ b/examples/stm32h5/src/bin/usart_split.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h5/src/bin/usb_serial.rs b/examples/stm32h5/src/bin/usb_serial.rs index 7d45818af..208493d8c 100644 --- a/examples/stm32h5/src/bin/usb_serial.rs +++ b/examples/stm32h5/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index c6aea3e11..31feeda45 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32h743bi to your chip name, if necessary. | 8 | # Change stm32h743bi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "chrono"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6", "dns"] } | 13 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6", "dns"] } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| @@ -31,7 +31,7 @@ critical-section = "1.1" | |||
| 31 | micromath = "2.0.0" | 31 | micromath = "2.0.0" |
| 32 | stm32-fmc = "0.3.0" | 32 | stm32-fmc = "0.3.0" |
| 33 | embedded-storage = "0.3.1" | 33 | embedded-storage = "0.3.1" |
| 34 | static_cell = { version = "2", features = ["nightly"]} | 34 | static_cell = "2" |
| 35 | chrono = { version = "^0.4", default-features = false } | 35 | chrono = { version = "^0.4", default-features = false } |
| 36 | 36 | ||
| 37 | # cargo build/run | 37 | # cargo build/run |
diff --git a/examples/stm32h7/src/bin/adc.rs b/examples/stm32h7/src/bin/adc.rs index e367827e9..fe6fe69a1 100644 --- a/examples/stm32h7/src/bin/adc.rs +++ b/examples/stm32h7/src/bin/adc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/blinky.rs b/examples/stm32h7/src/bin/blinky.rs index a9cab1ff4..1ee90a870 100644 --- a/examples/stm32h7/src/bin/blinky.rs +++ b/examples/stm32h7/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/button_exti.rs b/examples/stm32h7/src/bin/button_exti.rs index dfe587d41..67751187d 100644 --- a/examples/stm32h7/src/bin/button_exti.rs +++ b/examples/stm32h7/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs index 489fb03dd..e5a104baf 100644 --- a/examples/stm32h7/src/bin/camera.rs +++ b/examples/stm32h7/src/bin/camera.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 6 | use embassy_stm32::dcmi::{self, *}; | 5 | use embassy_stm32::dcmi::{self, *}; |
diff --git a/examples/stm32h7/src/bin/dac.rs b/examples/stm32h7/src/bin/dac.rs index f66268151..a9bf46de0 100644 --- a/examples/stm32h7/src/bin/dac.rs +++ b/examples/stm32h7/src/bin/dac.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32h7/src/bin/dac_dma.rs b/examples/stm32h7/src/bin/dac_dma.rs index c19fdd623..1481dd967 100644 --- a/examples/stm32h7/src/bin/dac_dma.rs +++ b/examples/stm32h7/src/bin/dac_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index dbddfc22f..cd9a27fcd 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -14,7 +13,7 @@ use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | |||
| 14 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 15 | use embedded_io_async::Write; | 14 | use embedded_io_async::Write; |
| 16 | use rand_core::RngCore; | 15 | use rand_core::RngCore; |
| 17 | use static_cell::make_static; | 16 | use static_cell::StaticCell; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | 18 | ||
| 20 | bind_interrupts!(struct Irqs { | 19 | bind_interrupts!(struct Irqs { |
| @@ -64,8 +63,9 @@ async fn main(spawner: Spawner) -> ! { | |||
| 64 | 63 | ||
| 65 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 64 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 66 | 65 | ||
| 66 | static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new(); | ||
| 67 | let device = Ethernet::new( | 67 | let device = Ethernet::new( |
| 68 | make_static!(PacketQueue::<16, 16>::new()), | 68 | PACKETS.init(PacketQueue::<4, 4>::new()), |
| 69 | p.ETH, | 69 | p.ETH, |
| 70 | Irqs, | 70 | Irqs, |
| 71 | p.PA1, | 71 | p.PA1, |
| @@ -89,11 +89,13 @@ async fn main(spawner: Spawner) -> ! { | |||
| 89 | //}); | 89 | //}); |
| 90 | 90 | ||
| 91 | // Init network stack | 91 | // Init network stack |
| 92 | let stack = &*make_static!(Stack::new( | 92 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 93 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | ||
| 94 | let stack = &*STACK.init(Stack::new( | ||
| 93 | device, | 95 | device, |
| 94 | config, | 96 | config, |
| 95 | make_static!(StackResources::<3>::new()), | 97 | RESOURCES.init(StackResources::<3>::new()), |
| 96 | seed | 98 | seed, |
| 97 | )); | 99 | )); |
| 98 | 100 | ||
| 99 | // Launch network task | 101 | // Launch network task |
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index 17e1d9fb7..dcc6e36e2 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -15,7 +14,7 @@ use embassy_time::Timer; | |||
| 15 | use embedded_io_async::Write; | 14 | use embedded_io_async::Write; |
| 16 | use embedded_nal_async::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpConnect}; | 15 | use embedded_nal_async::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpConnect}; |
| 17 | use rand_core::RngCore; | 16 | use rand_core::RngCore; |
| 18 | use static_cell::make_static; | 17 | use static_cell::StaticCell; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | 19 | ||
| 21 | bind_interrupts!(struct Irqs { | 20 | bind_interrupts!(struct Irqs { |
| @@ -65,8 +64,9 @@ async fn main(spawner: Spawner) -> ! { | |||
| 65 | 64 | ||
| 66 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; | 65 | let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; |
| 67 | 66 | ||
| 67 | static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new(); | ||
| 68 | let device = Ethernet::new( | 68 | let device = Ethernet::new( |
| 69 | make_static!(PacketQueue::<16, 16>::new()), | 69 | PACKETS.init(PacketQueue::<16, 16>::new()), |
| 70 | p.ETH, | 70 | p.ETH, |
| 71 | Irqs, | 71 | Irqs, |
| 72 | p.PA1, | 72 | p.PA1, |
| @@ -90,11 +90,13 @@ async fn main(spawner: Spawner) -> ! { | |||
| 90 | //}); | 90 | //}); |
| 91 | 91 | ||
| 92 | // Init network stack | 92 | // Init network stack |
| 93 | let stack = &*make_static!(Stack::new( | 93 | static STACK: StaticCell<Stack<Device>> = StaticCell::new(); |
| 94 | static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new(); | ||
| 95 | let stack = &*STACK.init(Stack::new( | ||
| 94 | device, | 96 | device, |
| 95 | config, | 97 | config, |
| 96 | make_static!(StackResources::<3>::new()), | 98 | RESOURCES.init(StackResources::<3>::new()), |
| 97 | seed | 99 | seed, |
| 98 | )); | 100 | )); |
| 99 | 101 | ||
| 100 | // Launch network task | 102 | // Launch network task |
diff --git a/examples/stm32h7/src/bin/flash.rs b/examples/stm32h7/src/bin/flash.rs index 89c0c8a66..4f9f6bb0a 100644 --- a/examples/stm32h7/src/bin/flash.rs +++ b/examples/stm32h7/src/bin/flash.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/fmc.rs b/examples/stm32h7/src/bin/fmc.rs index 54e2c3629..5e5e6ccc8 100644 --- a/examples/stm32h7/src/bin/fmc.rs +++ b/examples/stm32h7/src/bin/fmc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/i2c.rs b/examples/stm32h7/src/bin/i2c.rs index aea21ec6f..3bf39eb44 100644 --- a/examples/stm32h7/src/bin/i2c.rs +++ b/examples/stm32h7/src/bin/i2c.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs index e0be495d1..cc508c3cf 100644 --- a/examples/stm32h7/src/bin/low_level_timer_api.rs +++ b/examples/stm32h7/src/bin/low_level_timer_api.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -85,7 +84,7 @@ impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> { | |||
| 85 | 84 | ||
| 86 | let mut this = Self { inner: tim }; | 85 | let mut this = Self { inner: tim }; |
| 87 | 86 | ||
| 88 | this.set_freq(freq); | 87 | this.set_frequency(freq); |
| 89 | this.inner.start(); | 88 | this.inner.start(); |
| 90 | 89 | ||
| 91 | let r = T::regs_gp32(); | 90 | let r = T::regs_gp32(); |
| @@ -102,14 +101,14 @@ impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> { | |||
| 102 | } | 101 | } |
| 103 | 102 | ||
| 104 | pub fn enable(&mut self, channel: Channel) { | 103 | pub fn enable(&mut self, channel: Channel) { |
| 105 | T::regs_gp32().ccer().modify(|w| w.set_cce(channel.raw(), true)); | 104 | T::regs_gp32().ccer().modify(|w| w.set_cce(channel.index(), true)); |
| 106 | } | 105 | } |
| 107 | 106 | ||
| 108 | pub fn disable(&mut self, channel: Channel) { | 107 | pub fn disable(&mut self, channel: Channel) { |
| 109 | T::regs_gp32().ccer().modify(|w| w.set_cce(channel.raw(), false)); | 108 | T::regs_gp32().ccer().modify(|w| w.set_cce(channel.index(), false)); |
| 110 | } | 109 | } |
| 111 | 110 | ||
| 112 | pub fn set_freq(&mut self, freq: Hertz) { | 111 | pub fn set_frequency(&mut self, freq: Hertz) { |
| 113 | <T as embassy_stm32::timer::low_level::GeneralPurpose32bitInstance>::set_frequency(&mut self.inner, freq); | 112 | <T as embassy_stm32::timer::low_level::GeneralPurpose32bitInstance>::set_frequency(&mut self.inner, freq); |
| 114 | } | 113 | } |
| 115 | 114 | ||
| @@ -119,6 +118,6 @@ impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> { | |||
| 119 | 118 | ||
| 120 | pub fn set_duty(&mut self, channel: Channel, duty: u32) { | 119 | pub fn set_duty(&mut self, channel: Channel, duty: u32) { |
| 121 | defmt::assert!(duty < self.get_max_duty()); | 120 | defmt::assert!(duty < self.get_max_duty()); |
| 122 | T::regs_gp32().ccr(channel.raw()).modify(|w| w.set_ccr(duty)) | 121 | T::regs_gp32().ccr(channel.index()).modify(|w| w.set_ccr(duty)) |
| 123 | } | 122 | } |
| 124 | } | 123 | } |
diff --git a/examples/stm32h7/src/bin/mco.rs b/examples/stm32h7/src/bin/mco.rs index c023f4584..a6ee27625 100644 --- a/examples/stm32h7/src/bin/mco.rs +++ b/examples/stm32h7/src/bin/mco.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/pwm.rs b/examples/stm32h7/src/bin/pwm.rs index c55d780a0..1e48ba67b 100644 --- a/examples/stm32h7/src/bin/pwm.rs +++ b/examples/stm32h7/src/bin/pwm.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/rng.rs b/examples/stm32h7/src/bin/rng.rs index 1fb4cfec0..a9ef7200d 100644 --- a/examples/stm32h7/src/bin/rng.rs +++ b/examples/stm32h7/src/bin/rng.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/rtc.rs b/examples/stm32h7/src/bin/rtc.rs index 78cea9c89..c6b9cf57e 100644 --- a/examples/stm32h7/src/bin/rtc.rs +++ b/examples/stm32h7/src/bin/rtc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32h7/src/bin/sdmmc.rs b/examples/stm32h7/src/bin/sdmmc.rs index be968ff77..abe2d4ba7 100644 --- a/examples/stm32h7/src/bin/sdmmc.rs +++ b/examples/stm32h7/src/bin/sdmmc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/signal.rs b/examples/stm32h7/src/bin/signal.rs index b5f583289..b73360f32 100644 --- a/examples/stm32h7/src/bin/signal.rs +++ b/examples/stm32h7/src/bin/signal.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/spi.rs b/examples/stm32h7/src/bin/spi.rs index a8db0ff77..aed27723a 100644 --- a/examples/stm32h7/src/bin/spi.rs +++ b/examples/stm32h7/src/bin/spi.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | use core::str::from_utf8; | 5 | use core::str::from_utf8; |
diff --git a/examples/stm32h7/src/bin/spi_dma.rs b/examples/stm32h7/src/bin/spi_dma.rs index 561052e48..54d4d7656 100644 --- a/examples/stm32h7/src/bin/spi_dma.rs +++ b/examples/stm32h7/src/bin/spi_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | use core::str::from_utf8; | 5 | use core::str::from_utf8; |
diff --git a/examples/stm32h7/src/bin/usart.rs b/examples/stm32h7/src/bin/usart.rs index db04d4e55..f9cbad6af 100644 --- a/examples/stm32h7/src/bin/usart.rs +++ b/examples/stm32h7/src/bin/usart.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32h7/src/bin/usart_dma.rs b/examples/stm32h7/src/bin/usart_dma.rs index 249050fd1..ae1f3a2e9 100644 --- a/examples/stm32h7/src/bin/usart_dma.rs +++ b/examples/stm32h7/src/bin/usart_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | 5 | ||
diff --git a/examples/stm32h7/src/bin/usart_split.rs b/examples/stm32h7/src/bin/usart_split.rs index 61c9f1954..b98c40877 100644 --- a/examples/stm32h7/src/bin/usart_split.rs +++ b/examples/stm32h7/src/bin/usart_split.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/usb_serial.rs b/examples/stm32h7/src/bin/usb_serial.rs index f80cf63ec..d81efb541 100644 --- a/examples/stm32h7/src/bin/usb_serial.rs +++ b/examples/stm32h7/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32h7/src/bin/wdg.rs b/examples/stm32h7/src/bin/wdg.rs index 76fd9dfc0..a4184aa96 100644 --- a/examples/stm32h7/src/bin/wdg.rs +++ b/examples/stm32h7/src/bin/wdg.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index 7c8264739..739aa6cb1 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml | |||
| @@ -4,10 +4,6 @@ name = "embassy-stm32l0-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | 6 | ||
| 7 | [features] | ||
| 8 | default = ["nightly"] | ||
| 9 | nightly = ["embassy-executor/nightly"] | ||
| 10 | |||
| 11 | [dependencies] | 7 | [dependencies] |
| 12 | # Change stm32l072cz to your chip name, if necessary. | 8 | # Change stm32l072cz to your chip name, if necessary. |
| 13 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } |
diff --git a/examples/stm32l0/src/bin/blinky.rs b/examples/stm32l0/src/bin/blinky.rs index ea40bfc48..caca5759f 100644 --- a/examples/stm32l0/src/bin/blinky.rs +++ b/examples/stm32l0/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l0/src/bin/button.rs b/examples/stm32l0/src/bin/button.rs index 3e56160e9..165a714a5 100644 --- a/examples/stm32l0/src/bin/button.rs +++ b/examples/stm32l0/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l0/src/bin/button_exti.rs b/examples/stm32l0/src/bin/button_exti.rs index ffede253e..f517fce04 100644 --- a/examples/stm32l0/src/bin/button_exti.rs +++ b/examples/stm32l0/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l0/src/bin/flash.rs b/examples/stm32l0/src/bin/flash.rs index 86f6c70b9..1865748fd 100644 --- a/examples/stm32l0/src/bin/flash.rs +++ b/examples/stm32l0/src/bin/flash.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l0/src/bin/spi.rs b/examples/stm32l0/src/bin/spi.rs index 583e3d127..f23a537b8 100644 --- a/examples/stm32l0/src/bin/spi.rs +++ b/examples/stm32l0/src/bin/spi.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l0/src/bin/usart_dma.rs b/examples/stm32l0/src/bin/usart_dma.rs index 62c9b5595..74889c838 100644 --- a/examples/stm32l0/src/bin/usart_dma.rs +++ b/examples/stm32l0/src/bin/usart_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l0/src/bin/usart_irq.rs b/examples/stm32l0/src/bin/usart_irq.rs index 5107a1a0a..2c96a8bc2 100644 --- a/examples/stm32l0/src/bin/usart_irq.rs +++ b/examples/stm32l0/src/bin/usart_irq.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml index 23dd0ef87..071d6a502 100644 --- a/examples/stm32l1/Cargo.toml +++ b/examples/stm32l1/Cargo.toml | |||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } |
| 12 | 12 | ||
diff --git a/examples/stm32l1/src/bin/blinky.rs b/examples/stm32l1/src/bin/blinky.rs index 06f732eb7..da6777b2d 100644 --- a/examples/stm32l1/src/bin/blinky.rs +++ b/examples/stm32l1/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l1/src/bin/flash.rs b/examples/stm32l1/src/bin/flash.rs index aeb535cca..e9ce4eae8 100644 --- a/examples/stm32l1/src/bin/flash.rs +++ b/examples/stm32l1/src/bin/flash.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l1/src/bin/spi.rs b/examples/stm32l1/src/bin/spi.rs index 905b4d75c..8be686c5a 100644 --- a/examples/stm32l1/src/bin/spi.rs +++ b/examples/stm32l1/src/bin/spi.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml index 2861216d4..8a5fb5749 100644 --- a/examples/stm32l4/Cargo.toml +++ b/examples/stm32l4/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32l4s5vi to your chip name, if necessary. | 8 | # Change stm32l4s5vi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "chrono"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", ] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", ] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| @@ -32,7 +32,7 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa | |||
| 32 | heapless = { version = "0.8", default-features = false } | 32 | heapless = { version = "0.8", default-features = false } |
| 33 | chrono = { version = "^0.4", default-features = false } | 33 | chrono = { version = "^0.4", default-features = false } |
| 34 | rand = { version = "0.8.5", default-features = false } | 34 | rand = { version = "0.8.5", default-features = false } |
| 35 | static_cell = { version = "2", features = ["nightly"]} | 35 | static_cell = "2" |
| 36 | 36 | ||
| 37 | micromath = "2.0.0" | 37 | micromath = "2.0.0" |
| 38 | 38 | ||
diff --git a/examples/stm32l4/src/bin/adc.rs b/examples/stm32l4/src/bin/adc.rs index a0ec5c33e..d01e9f1b3 100644 --- a/examples/stm32l4/src/bin/adc.rs +++ b/examples/stm32l4/src/bin/adc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_stm32::adc::{Adc, Resolution}; | 5 | use embassy_stm32::adc::{Adc, Resolution}; |
diff --git a/examples/stm32l4/src/bin/blinky.rs b/examples/stm32l4/src/bin/blinky.rs index 6202fe2f7..b55dfd35e 100644 --- a/examples/stm32l4/src/bin/blinky.rs +++ b/examples/stm32l4/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/src/bin/button.rs b/examples/stm32l4/src/bin/button.rs index 0a102c2d6..15288c61e 100644 --- a/examples/stm32l4/src/bin/button.rs +++ b/examples/stm32l4/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_stm32::gpio::{Input, Pull}; | 5 | use embassy_stm32::gpio::{Input, Pull}; |
diff --git a/examples/stm32l4/src/bin/button_exti.rs b/examples/stm32l4/src/bin/button_exti.rs index ef32d4c4a..1e970fdd6 100644 --- a/examples/stm32l4/src/bin/button_exti.rs +++ b/examples/stm32l4/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/src/bin/dac.rs b/examples/stm32l4/src/bin/dac.rs index d6a7ff624..fdbf1d374 100644 --- a/examples/stm32l4/src/bin/dac.rs +++ b/examples/stm32l4/src/bin/dac.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_stm32::dac::{DacCh1, Value}; | 5 | use embassy_stm32::dac::{DacCh1, Value}; |
diff --git a/examples/stm32l4/src/bin/dac_dma.rs b/examples/stm32l4/src/bin/dac_dma.rs index dc86dbf43..64c541caa 100644 --- a/examples/stm32l4/src/bin/dac_dma.rs +++ b/examples/stm32l4/src/bin/dac_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/src/bin/i2c.rs b/examples/stm32l4/src/bin/i2c.rs index 07dc12e8c..f553deb82 100644 --- a/examples/stm32l4/src/bin/i2c.rs +++ b/examples/stm32l4/src/bin/i2c.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/src/bin/i2c_blocking_async.rs b/examples/stm32l4/src/bin/i2c_blocking_async.rs index 60a4e2eb3..1b8652bcc 100644 --- a/examples/stm32l4/src/bin/i2c_blocking_async.rs +++ b/examples/stm32l4/src/bin/i2c_blocking_async.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_embedded_hal::adapter::BlockingAsync; | 5 | use embassy_embedded_hal::adapter::BlockingAsync; |
diff --git a/examples/stm32l4/src/bin/i2c_dma.rs b/examples/stm32l4/src/bin/i2c_dma.rs index 4c2c224a6..794972a33 100644 --- a/examples/stm32l4/src/bin/i2c_dma.rs +++ b/examples/stm32l4/src/bin/i2c_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/src/bin/mco.rs b/examples/stm32l4/src/bin/mco.rs index 504879887..36c002952 100644 --- a/examples/stm32l4/src/bin/mco.rs +++ b/examples/stm32l4/src/bin/mco.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/src/bin/rng.rs b/examples/stm32l4/src/bin/rng.rs index e5ad56fb9..638b3e9e4 100644 --- a/examples/stm32l4/src/bin/rng.rs +++ b/examples/stm32l4/src/bin/rng.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/src/bin/rtc.rs b/examples/stm32l4/src/bin/rtc.rs index d2a2aa1f2..526620bfb 100644 --- a/examples/stm32l4/src/bin/rtc.rs +++ b/examples/stm32l4/src/bin/rtc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs index 8ec810c7f..9565ae168 100644 --- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs +++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs | |||
| @@ -1,10 +1,7 @@ | |||
| 1 | #![deny(clippy::pedantic)] | ||
| 2 | #![allow(clippy::doc_markdown)] | ||
| 3 | #![no_main] | 1 | #![no_main] |
| 4 | #![no_std] | 2 | #![no_std] |
| 5 | // Needed unitl https://github.com/rust-lang/rust/issues/63063 is stablised. | 3 | #![deny(clippy::pedantic)] |
| 6 | #![feature(type_alias_impl_trait)] | 4 | #![allow(clippy::doc_markdown)] |
| 7 | #![feature(associated_type_bounds)] | ||
| 8 | #![allow(clippy::missing_errors_doc)] | 5 | #![allow(clippy::missing_errors_doc)] |
| 9 | 6 | ||
| 10 | // This example works on a ANALOG DEVICE EVAL-ADIN110EBZ board. | 7 | // This example works on a ANALOG DEVICE EVAL-ADIN110EBZ board. |
| @@ -36,7 +33,7 @@ use hal::rng::{self, Rng}; | |||
| 36 | use hal::{bind_interrupts, exti, pac, peripherals}; | 33 | use hal::{bind_interrupts, exti, pac, peripherals}; |
| 37 | use heapless::Vec; | 34 | use heapless::Vec; |
| 38 | use rand::RngCore; | 35 | use rand::RngCore; |
| 39 | use static_cell::make_static; | 36 | use static_cell::StaticCell; |
| 40 | use {embassy_stm32 as hal, panic_probe as _}; | 37 | use {embassy_stm32 as hal, panic_probe as _}; |
| 41 | 38 | ||
| 42 | bind_interrupts!(struct Irqs { | 39 | bind_interrupts!(struct Irqs { |
| @@ -180,7 +177,8 @@ async fn main(spawner: Spawner) { | |||
| 180 | } | 177 | } |
| 181 | }; | 178 | }; |
| 182 | 179 | ||
| 183 | let state = make_static!(embassy_net_adin1110::State::<8, 8>::new()); | 180 | static STATE: StaticCell<embassy_net_adin1110::State<8, 8>> = StaticCell::new(); |
| 181 | let state = STATE.init(embassy_net_adin1110::State::<8, 8>::new()); | ||
| 184 | 182 | ||
| 185 | let (device, runner) = embassy_net_adin1110::new( | 183 | let (device, runner) = embassy_net_adin1110::new( |
| 186 | MAC, | 184 | MAC, |
| @@ -217,11 +215,13 @@ async fn main(spawner: Spawner) { | |||
| 217 | }; | 215 | }; |
| 218 | 216 | ||
| 219 | // Init network stack | 217 | // Init network stack |
| 220 | let stack = &*make_static!(Stack::new( | 218 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 219 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 220 | let stack = &*STACK.init(Stack::new( | ||
| 221 | device, | 221 | device, |
| 222 | ip_cfg, | 222 | ip_cfg, |
| 223 | make_static!(StackResources::<2>::new()), | 223 | RESOURCES.init(StackResources::<2>::new()), |
| 224 | seed | 224 | seed, |
| 225 | )); | 225 | )); |
| 226 | 226 | ||
| 227 | // Launch network task | 227 | // Launch network task |
diff --git a/examples/stm32l4/src/bin/spi.rs b/examples/stm32l4/src/bin/spi.rs index 54cf68f7b..6653e4516 100644 --- a/examples/stm32l4/src/bin/spi.rs +++ b/examples/stm32l4/src/bin/spi.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_stm32::dma::NoDma; | 5 | use embassy_stm32::dma::NoDma; |
diff --git a/examples/stm32l4/src/bin/spi_blocking_async.rs b/examples/stm32l4/src/bin/spi_blocking_async.rs index 903ca58df..a989a5a4a 100644 --- a/examples/stm32l4/src/bin/spi_blocking_async.rs +++ b/examples/stm32l4/src/bin/spi_blocking_async.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_embedded_hal::adapter::BlockingAsync; | 5 | use embassy_embedded_hal::adapter::BlockingAsync; |
diff --git a/examples/stm32l4/src/bin/spi_dma.rs b/examples/stm32l4/src/bin/spi_dma.rs index 58cf2e51e..7922165df 100644 --- a/examples/stm32l4/src/bin/spi_dma.rs +++ b/examples/stm32l4/src/bin/spi_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l4/src/bin/usart.rs b/examples/stm32l4/src/bin/usart.rs index f4da6b5ae..7bab23950 100644 --- a/examples/stm32l4/src/bin/usart.rs +++ b/examples/stm32l4/src/bin/usart.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_stm32::dma::NoDma; | 5 | use embassy_stm32::dma::NoDma; |
diff --git a/examples/stm32l4/src/bin/usart_dma.rs b/examples/stm32l4/src/bin/usart_dma.rs index 2f3b2a0f0..031888f70 100644 --- a/examples/stm32l4/src/bin/usart_dma.rs +++ b/examples/stm32l4/src/bin/usart_dma.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::fmt::Write; | 4 | use core::fmt::Write; |
| 6 | 5 | ||
diff --git a/examples/stm32l4/src/bin/usb_serial.rs b/examples/stm32l4/src/bin/usb_serial.rs index 4baf5f05d..8cc9a7aed 100644 --- a/examples/stm32l4/src/bin/usb_serial.rs +++ b/examples/stm32l4/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use defmt_rtt as _; // global logger | 5 | use defmt_rtt as _; // global logger |
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml index 2557ef42d..0d236ec90 100644 --- a/examples/stm32l5/Cargo.toml +++ b/examples/stm32l5/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32l552ze to your chip name, if necessary. | 8 | # Change stm32l552ze to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "memory-x"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "memory-x"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } | 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } |
| @@ -26,7 +26,7 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa | |||
| 26 | heapless = { version = "0.8", default-features = false } | 26 | heapless = { version = "0.8", default-features = false } |
| 27 | rand_core = { version = "0.6.3", default-features = false } | 27 | rand_core = { version = "0.6.3", default-features = false } |
| 28 | embedded-io-async = { version = "0.6.1" } | 28 | embedded-io-async = { version = "0.6.1" } |
| 29 | static_cell = { version = "2", features = ["nightly"]} | 29 | static_cell = "2" |
| 30 | 30 | ||
| 31 | [profile.release] | 31 | [profile.release] |
| 32 | debug = 2 | 32 | debug = 2 |
diff --git a/examples/stm32l5/src/bin/button_exti.rs b/examples/stm32l5/src/bin/button_exti.rs index e80ad2b3a..91d0ccc2e 100644 --- a/examples/stm32l5/src/bin/button_exti.rs +++ b/examples/stm32l5/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l5/src/bin/rng.rs b/examples/stm32l5/src/bin/rng.rs index 279f4f65d..50da6c946 100644 --- a/examples/stm32l5/src/bin/rng.rs +++ b/examples/stm32l5/src/bin/rng.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs index 0b0a0e2db..88060b6b0 100644 --- a/examples/stm32l5/src/bin/usb_ethernet.rs +++ b/examples/stm32l5/src/bin/usb_ethernet.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -15,7 +14,7 @@ use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; | |||
| 15 | use embassy_usb::{Builder, UsbDevice}; | 14 | use embassy_usb::{Builder, UsbDevice}; |
| 16 | use embedded_io_async::Write; | 15 | use embedded_io_async::Write; |
| 17 | use rand_core::RngCore; | 16 | use rand_core::RngCore; |
| 18 | use static_cell::make_static; | 17 | use static_cell::StaticCell; |
| 19 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 20 | 19 | ||
| 21 | type MyDriver = Driver<'static, embassy_stm32::peripherals::USB>; | 20 | type MyDriver = Driver<'static, embassy_stm32::peripherals::USB>; |
| @@ -76,14 +75,18 @@ async fn main(spawner: Spawner) { | |||
| 76 | config.device_protocol = 0x01; | 75 | config.device_protocol = 0x01; |
| 77 | 76 | ||
| 78 | // Create embassy-usb DeviceBuilder using the driver and config. | 77 | // Create embassy-usb DeviceBuilder using the driver and config. |
| 78 | static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 79 | static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 80 | static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new(); | ||
| 81 | static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new(); | ||
| 79 | let mut builder = Builder::new( | 82 | let mut builder = Builder::new( |
| 80 | driver, | 83 | driver, |
| 81 | config, | 84 | config, |
| 82 | &mut make_static!([0; 256])[..], | 85 | &mut DEVICE_DESC.init([0; 256])[..], |
| 83 | &mut make_static!([0; 256])[..], | 86 | &mut CONFIG_DESC.init([0; 256])[..], |
| 84 | &mut make_static!([0; 256])[..], | 87 | &mut BOS_DESC.init([0; 256])[..], |
| 85 | &mut [], // no msos descriptors | 88 | &mut [], // no msos descriptors |
| 86 | &mut make_static!([0; 128])[..], | 89 | &mut CONTROL_BUF.init([0; 128])[..], |
| 87 | ); | 90 | ); |
| 88 | 91 | ||
| 89 | // Our MAC addr. | 92 | // Our MAC addr. |
| @@ -92,14 +95,16 @@ async fn main(spawner: Spawner) { | |||
| 92 | let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; | 95 | let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; |
| 93 | 96 | ||
| 94 | // Create classes on the builder. | 97 | // Create classes on the builder. |
| 95 | let class = CdcNcmClass::new(&mut builder, make_static!(State::new()), host_mac_addr, 64); | 98 | static STATE: StaticCell<State> = StaticCell::new(); |
| 99 | let class = CdcNcmClass::new(&mut builder, STATE.init(State::new()), host_mac_addr, 64); | ||
| 96 | 100 | ||
| 97 | // Build the builder. | 101 | // Build the builder. |
| 98 | let usb = builder.build(); | 102 | let usb = builder.build(); |
| 99 | 103 | ||
| 100 | unwrap!(spawner.spawn(usb_task(usb))); | 104 | unwrap!(spawner.spawn(usb_task(usb))); |
| 101 | 105 | ||
| 102 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); | 106 | static NET_STATE: StaticCell<NetState<MTU, 4, 4>> = StaticCell::new(); |
| 107 | let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(NET_STATE.init(NetState::new()), our_mac_addr); | ||
| 103 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 108 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 104 | 109 | ||
| 105 | let config = embassy_net::Config::dhcpv4(Default::default()); | 110 | let config = embassy_net::Config::dhcpv4(Default::default()); |
| @@ -114,11 +119,13 @@ async fn main(spawner: Spawner) { | |||
| 114 | let seed = rng.next_u64(); | 119 | let seed = rng.next_u64(); |
| 115 | 120 | ||
| 116 | // Init network stack | 121 | // Init network stack |
| 117 | let stack = &*make_static!(Stack::new( | 122 | static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new(); |
| 123 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 124 | let stack = &*STACK.init(Stack::new( | ||
| 118 | device, | 125 | device, |
| 119 | config, | 126 | config, |
| 120 | make_static!(StackResources::<2>::new()), | 127 | RESOURCES.init(StackResources::<2>::new()), |
| 121 | seed | 128 | seed, |
| 122 | )); | 129 | )); |
| 123 | 130 | ||
| 124 | unwrap!(spawner.spawn(net_task(stack))); | 131 | unwrap!(spawner.spawn(net_task(stack))); |
diff --git a/examples/stm32l5/src/bin/usb_hid_mouse.rs b/examples/stm32l5/src/bin/usb_hid_mouse.rs index 3614a8e0a..7c8a8ebfb 100644 --- a/examples/stm32l5/src/bin/usb_hid_mouse.rs +++ b/examples/stm32l5/src/bin/usb_hid_mouse.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l5/src/bin/usb_serial.rs b/examples/stm32l5/src/bin/usb_serial.rs index f2b894b68..75053ce4b 100644 --- a/examples/stm32l5/src/bin/usb_serial.rs +++ b/examples/stm32l5/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml index 1afbd8db4..029b2cfe0 100644 --- a/examples/stm32u5/Cargo.toml +++ b/examples/stm32u5/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32u585ai to your chip name, if necessary. | 8 | # Change stm32u585ai to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | 14 | ||
diff --git a/examples/stm32u5/src/bin/blinky.rs b/examples/stm32u5/src/bin/blinky.rs index 4b44cb12b..7fe88c183 100644 --- a/examples/stm32u5/src/bin/blinky.rs +++ b/examples/stm32u5/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32u5/src/bin/boot.rs b/examples/stm32u5/src/bin/boot.rs index e2112ce5c..23c7f8b22 100644 --- a/examples/stm32u5/src/bin/boot.rs +++ b/examples/stm32u5/src/bin/boot.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use {defmt_rtt as _, embassy_stm32 as _, panic_probe as _}; | 5 | use {defmt_rtt as _, embassy_stm32 as _, panic_probe as _}; |
diff --git a/examples/stm32u5/src/bin/usb_serial.rs b/examples/stm32u5/src/bin/usb_serial.rs index 839d6472f..44d1df4f1 100644 --- a/examples/stm32u5/src/bin/usb_serial.rs +++ b/examples/stm32u5/src/bin/usb_serial.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{panic, *}; | 4 | use defmt::{panic, *}; |
| 6 | use defmt_rtt as _; // global logger | 5 | use defmt_rtt as _; // global logger |
diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index ada1f32e9..bce53c440 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] } |
| 10 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] } | 10 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] } |
| 11 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 11 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 12 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 12 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 13 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true } | 14 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true } |
| 15 | 15 | ||
| @@ -22,7 +22,7 @@ embedded-hal = "0.2.6" | |||
| 22 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 22 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
| 23 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 23 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
| 24 | heapless = { version = "0.8", default-features = false } | 24 | heapless = { version = "0.8", default-features = false } |
| 25 | static_cell = { version = "2", features = ["nightly"]} | 25 | static_cell = "2" |
| 26 | 26 | ||
| 27 | [features] | 27 | [features] |
| 28 | default = ["ble", "mac"] | 28 | default = ["ble", "mac"] |
diff --git a/examples/stm32wb/src/bin/blinky.rs b/examples/stm32wb/src/bin/blinky.rs index 1394f03fa..f37e8b1d8 100644 --- a/examples/stm32wb/src/bin/blinky.rs +++ b/examples/stm32wb/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wb/src/bin/button_exti.rs b/examples/stm32wb/src/bin/button_exti.rs index 3648db6ff..d34dde3e9 100644 --- a/examples/stm32wb/src/bin/button_exti.rs +++ b/examples/stm32wb/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wb/src/bin/eddystone_beacon.rs b/examples/stm32wb/src/bin/eddystone_beacon.rs index e58da8e35..cf9a5aa28 100644 --- a/examples/stm32wb/src/bin/eddystone_beacon.rs +++ b/examples/stm32wb/src/bin/eddystone_beacon.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::time::Duration; | 4 | use core::time::Duration; |
| 6 | 5 | ||
diff --git a/examples/stm32wb/src/bin/gatt_server.rs b/examples/stm32wb/src/bin/gatt_server.rs index 80e835c1d..5ce620350 100644 --- a/examples/stm32wb/src/bin/gatt_server.rs +++ b/examples/stm32wb/src/bin/gatt_server.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use core::time::Duration; | 4 | use core::time::Duration; |
| 6 | 5 | ||
diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs index 881dc488d..5cd660543 100644 --- a/examples/stm32wb/src/bin/mac_ffd.rs +++ b/examples/stm32wb/src/bin/mac_ffd.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wb/src/bin/mac_ffd_net.rs b/examples/stm32wb/src/bin/mac_ffd_net.rs index f8c76b5a4..7a42bf577 100644 --- a/examples/stm32wb/src/bin/mac_ffd_net.rs +++ b/examples/stm32wb/src/bin/mac_ffd_net.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| @@ -12,7 +11,7 @@ use embassy_stm32_wpan::mac::typedefs::{MacChannel, PanId, PibId}; | |||
| 12 | use embassy_stm32_wpan::mac::{self, Runner}; | 11 | use embassy_stm32_wpan::mac::{self, Runner}; |
| 13 | use embassy_stm32_wpan::sub::mm; | 12 | use embassy_stm32_wpan::sub::mm; |
| 14 | use embassy_stm32_wpan::TlMbox; | 13 | use embassy_stm32_wpan::TlMbox; |
| 15 | use static_cell::make_static; | 14 | use static_cell::StaticCell; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 16 | ||
| 18 | bind_interrupts!(struct Irqs{ | 17 | bind_interrupts!(struct Irqs{ |
| @@ -154,15 +153,21 @@ async fn main(spawner: Spawner) { | |||
| 154 | .unwrap(); | 153 | .unwrap(); |
| 155 | defmt::info!("{:#x}", mbox.mac_subsystem.read().await.unwrap()); | 154 | defmt::info!("{:#x}", mbox.mac_subsystem.read().await.unwrap()); |
| 156 | 155 | ||
| 156 | static TX1: StaticCell<[u8; 127]> = StaticCell::new(); | ||
| 157 | static TX2: StaticCell<[u8; 127]> = StaticCell::new(); | ||
| 158 | static TX3: StaticCell<[u8; 127]> = StaticCell::new(); | ||
| 159 | static TX4: StaticCell<[u8; 127]> = StaticCell::new(); | ||
| 160 | static TX5: StaticCell<[u8; 127]> = StaticCell::new(); | ||
| 157 | let tx_queue = [ | 161 | let tx_queue = [ |
| 158 | make_static!([0u8; 127]), | 162 | TX1.init([0u8; 127]), |
| 159 | make_static!([0u8; 127]), | 163 | TX2.init([0u8; 127]), |
| 160 | make_static!([0u8; 127]), | 164 | TX3.init([0u8; 127]), |
| 161 | make_static!([0u8; 127]), | 165 | TX4.init([0u8; 127]), |
| 162 | make_static!([0u8; 127]), | 166 | TX5.init([0u8; 127]), |
| 163 | ]; | 167 | ]; |
| 164 | 168 | ||
| 165 | let runner = make_static!(Runner::new(mbox.mac_subsystem, tx_queue)); | 169 | static RUNNER: StaticCell<Runner> = StaticCell::new(); |
| 170 | let runner = RUNNER.init(Runner::new(mbox.mac_subsystem, tx_queue)); | ||
| 166 | 171 | ||
| 167 | spawner.spawn(run_mac(runner)).unwrap(); | 172 | spawner.spawn(run_mac(runner)).unwrap(); |
| 168 | 173 | ||
diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs index 000355de6..7949211fb 100644 --- a/examples/stm32wb/src/bin/mac_rfd.rs +++ b/examples/stm32wb/src/bin/mac_rfd.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wb/src/bin/tl_mbox.rs b/examples/stm32wb/src/bin/tl_mbox.rs index 9d0e0070c..cb92d462d 100644 --- a/examples/stm32wb/src/bin/tl_mbox.rs +++ b/examples/stm32wb/src/bin/tl_mbox.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wb/src/bin/tl_mbox_ble.rs b/examples/stm32wb/src/bin/tl_mbox_ble.rs index 12c6aeebb..2599e1151 100644 --- a/examples/stm32wb/src/bin/tl_mbox_ble.rs +++ b/examples/stm32wb/src/bin/tl_mbox_ble.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wb/src/bin/tl_mbox_mac.rs b/examples/stm32wb/src/bin/tl_mbox_mac.rs index f32e07d96..5d868412a 100644 --- a/examples/stm32wb/src/bin/tl_mbox_mac.rs +++ b/examples/stm32wb/src/bin/tl_mbox_mac.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wba/Cargo.toml b/examples/stm32wba/Cargo.toml index c97605937..84eb6c831 100644 --- a/examples/stm32wba/Cargo.toml +++ b/examples/stm32wba/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba52cg", "time-driver-any", "memory-x", "exti"] } | 8 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba52cg", "time-driver-any", "memory-x", "exti"] } |
| 9 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 9 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 10 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 10 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 11 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 11 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 12 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true } | 12 | embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true } |
| 13 | 13 | ||
| @@ -20,7 +20,7 @@ embedded-hal = "0.2.6" | |||
| 20 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 20 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
| 21 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | 21 | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } |
| 22 | heapless = { version = "0.8", default-features = false } | 22 | heapless = { version = "0.8", default-features = false } |
| 23 | static_cell = { version = "2", features = ["nightly"]} | 23 | static_cell = "2" |
| 24 | 24 | ||
| 25 | [profile.release] | 25 | [profile.release] |
| 26 | debug = 2 | 26 | debug = 2 |
diff --git a/examples/stm32wba/src/bin/blinky.rs b/examples/stm32wba/src/bin/blinky.rs index 6b9635e66..0d803b257 100644 --- a/examples/stm32wba/src/bin/blinky.rs +++ b/examples/stm32wba/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wba/src/bin/button_exti.rs b/examples/stm32wba/src/bin/button_exti.rs index ef32d4c4a..1e970fdd6 100644 --- a/examples/stm32wba/src/bin/button_exti.rs +++ b/examples/stm32wba/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml index 070d27cb6..62c34b792 100644 --- a/examples/stm32wl/Cargo.toml +++ b/examples/stm32wl/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | # Change stm32wl55jc-cm4 to your chip name, if necessary. | 8 | # Change stm32wl55jc-cm4 to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] } |
| 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 14 | 14 | ||
diff --git a/examples/stm32wl/src/bin/blinky.rs b/examples/stm32wl/src/bin/blinky.rs index 5bd5745f0..347bd093f 100644 --- a/examples/stm32wl/src/bin/blinky.rs +++ b/examples/stm32wl/src/bin/blinky.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wl/src/bin/button.rs b/examples/stm32wl/src/bin/button.rs index 6c1f5a5ef..3397e5ba6 100644 --- a/examples/stm32wl/src/bin/button.rs +++ b/examples/stm32wl/src/bin/button.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use cortex_m_rt::entry; | 4 | use cortex_m_rt::entry; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32wl/src/bin/button_exti.rs b/examples/stm32wl/src/bin/button_exti.rs index 1f02db5cf..e6ad4b80b 100644 --- a/examples/stm32wl/src/bin/button_exti.rs +++ b/examples/stm32wl/src/bin/button_exti.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wl/src/bin/flash.rs b/examples/stm32wl/src/bin/flash.rs index 5e52d49ec..0b7417c01 100644 --- a/examples/stm32wl/src/bin/flash.rs +++ b/examples/stm32wl/src/bin/flash.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::{info, unwrap}; | 4 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wl/src/bin/random.rs b/examples/stm32wl/src/bin/random.rs index 2fd234966..3610392be 100644 --- a/examples/stm32wl/src/bin/random.rs +++ b/examples/stm32wl/src/bin/random.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wl/src/bin/rtc.rs b/examples/stm32wl/src/bin/rtc.rs index 4ffb0bb58..4738d5770 100644 --- a/examples/stm32wl/src/bin/rtc.rs +++ b/examples/stm32wl/src/bin/rtc.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use chrono::{NaiveDate, NaiveDateTime}; | 4 | use chrono::{NaiveDate, NaiveDateTime}; |
| 6 | use defmt::*; | 5 | use defmt::*; |
diff --git a/examples/stm32wl/src/bin/uart_async.rs b/examples/stm32wl/src/bin/uart_async.rs index 44e8f83a2..8e545834c 100644 --- a/examples/stm32wl/src/bin/uart_async.rs +++ b/examples/stm32wl/src/bin/uart_async.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | 3 | ||
| 5 | use defmt::*; | 4 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index c96a428b9..305ebd526 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml | |||
| @@ -9,7 +9,7 @@ crate-type = ["cdylib"] | |||
| 9 | 9 | ||
| 10 | [dependencies] | 10 | [dependencies] |
| 11 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["log"] } | 11 | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["log"] } |
| 12 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "nightly", "integrated-timers"] } | 12 | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["log", "wasm", ] } | 13 | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["log", "wasm", ] } |
| 14 | 14 | ||
| 15 | wasm-logger = "0.2.0" | 15 | wasm-logger = "0.2.0" |
diff --git a/examples/wasm/src/lib.rs b/examples/wasm/src/lib.rs index 1141096fb..71cf980dd 100644 --- a/examples/wasm/src/lib.rs +++ b/examples/wasm/src/lib.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | ||
| 2 | |||
| 3 | use embassy_executor::Spawner; | 1 | use embassy_executor::Spawner; |
| 4 | use embassy_time::Timer; | 2 | use embassy_time::Timer; |
| 5 | 3 | ||
