From 152c0180dfc9daa738f2e060c0b6253c86a03860 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 17 Jun 2024 12:23:31 +0200 Subject: [PATCH] esp-hal-wifi: make executors optional (again) (#1683) * esp-hal-wifi: make executors optional (again) * esp-wifi: don't use default-features of `esp-hal-embassy` --- esp-hal-embassy/Cargo.toml | 10 +++++++--- esp-hal-embassy/src/lib.rs | 2 ++ esp-hal/CHANGELOG.md | 1 + esp-wifi/Cargo.toml | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/esp-hal-embassy/Cargo.toml b/esp-hal-embassy/Cargo.toml index 2a7a36cf8..ab96c702b 100644 --- a/esp-hal-embassy/Cargo.toml +++ b/esp-hal-embassy/Cargo.toml @@ -15,7 +15,7 @@ features = ["esp32c6", "time-timg0"] critical-section = "1.1.2" defmt = { version = "0.3.8", optional = true } document-features = "0.2.8" -embassy-executor = "0.5.0" +embassy-executor = { version = "0.5.0", optional = true } embassy-time-driver = "0.1.0" esp-hal = { version = "0.18.0", path = "../esp-hal" } portable-atomic = "1.6.0" @@ -26,6 +26,8 @@ esp-build = { version = "0.1.0", path = "../esp-build" } esp-metadata = { version = "0.1.1", path = "../esp-metadata" } [features] +default = ["executors"] + esp32 = ["esp-hal/esp32"] esp32c2 = ["esp-hal/esp32c2"] esp32c3 = ["esp-hal/esp32c3"] @@ -35,9 +37,11 @@ esp32s2 = ["esp-hal/esp32s2"] esp32s3 = ["esp-hal/esp32s3"] ## Implement `defmt::Format` on certain types. -defmt = ["dep:defmt", "embassy-executor/defmt", "esp-hal/defmt"] +defmt = ["dep:defmt", "embassy-executor?/defmt", "esp-hal/defmt"] +## Provide `Executor` and `InterruptExecutor` +executors = ["dep:embassy-executor"] ## Use the executor-integrated `embassy-time` timer queue. -integrated-timers = ["embassy-executor/integrated-timers"] +integrated-timers = ["embassy-executor?/integrated-timers"] #! ### Time Driver Feature Flags ## SYSTIMER (16MHz) diff --git a/esp-hal-embassy/src/lib.rs b/esp-hal-embassy/src/lib.rs index 3a1ef10e4..245b9d00b 100644 --- a/esp-hal-embassy/src/lib.rs +++ b/esp-hal-embassy/src/lib.rs @@ -41,9 +41,11 @@ use core::cell::Cell; use embassy_time_driver::{AlarmHandle, Driver}; use esp_hal::clock::Clocks; +#[cfg(feature = "executors")] pub use self::executor::{Executor, InterruptExecutor}; use self::time_driver::{EmbassyTimer, TimerType}; +#[cfg(feature = "executors")] mod executor; mod time_driver; diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index f82d47c9e..3521cd95f 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Refactor `Dac1`/`Dac2` drivers into a single `Dac` driver (#1661) +- esp-hal-embassy: make executor code optional (but default) again ### Removed - uart: Removed `configure_pins` methods (#1592) diff --git a/esp-wifi/Cargo.toml b/esp-wifi/Cargo.toml index f1575c494..5d9908442 100644 --- a/esp-wifi/Cargo.toml +++ b/esp-wifi/Cargo.toml @@ -13,7 +13,7 @@ categories = ["embedded", "hardware-support", "no-std"] [dependencies] defmt = { version = "0.3.8", optional = true } esp-hal = { version = "0.18.0", path = "../esp-hal", default-features = false } -esp-hal-embassy = { version = "0.1.0", path = "../esp-hal-embassy", optional = true } +esp-hal-embassy = { version = "0.1.0", path = "../esp-hal-embassy", default-features = false, optional = true } smoltcp = { version = "0.11.0", default-features = false, features = [ "medium-ethernet", "socket-raw",