From 272dfc427e1cf3b4ab934d71806810d5ac6b855a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Tue, 27 Aug 2024 18:19:09 +0200 Subject: [PATCH] Re-add feature gate for software_interrupt3 --- esp-hal-embassy/Cargo.toml | 2 +- esp-hal/CHANGELOG.md | 1 + esp-hal/Cargo.toml | 2 ++ esp-hal/src/system.rs | 9 ++++++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/esp-hal-embassy/Cargo.toml b/esp-hal-embassy/Cargo.toml index 83ceebff460..6c6b67723c3 100644 --- a/esp-hal-embassy/Cargo.toml +++ b/esp-hal-embassy/Cargo.toml @@ -17,7 +17,7 @@ defmt = { version = "0.3.8", optional = true } document-features = "0.2.10" embassy-executor = { version = "0.6.0", optional = true } embassy-time-driver = { version = "0.1.0", features = [ "tick-hz-1_000_000" ] } -esp-hal = { version = "0.19.0", path = "../esp-hal" } +esp-hal = { version = "0.19.0", path = "../esp-hal", features = ["__esp_hal_embassy"] } log = { version = "0.4.22", optional = true } macros = { version = "0.12.0", features = ["embassy"], package = "esp-hal-procmacros", path = "../esp-hal-procmacros" } portable-atomic = "1.6.0" diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index c3e38928585..573a34e09ed 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - We should no longer generate 1GB .elf files for ESP32C2 and ESP32C3 (#1962) - Reset peripherals in driver constructors where missing (#1893, #1961) - Fixed ESP32-S2 systimer interrupts (#1979) +- Software interrupt 3 is no longer available when it is required by `esp-hal-embassy`. (#2011) ### Removed diff --git a/esp-hal/Cargo.toml b/esp-hal/Cargo.toml index a20f8d0fa5d..fe7cde90dac 100644 --- a/esp-hal/Cargo.toml +++ b/esp-hal/Cargo.toml @@ -85,6 +85,8 @@ bluetooth = [] usb-otg = ["esp-synopsys-usb-otg", "usb-device"] +__esp_hal_embassy = [] + ## Enable debug features in the HAL (used for development). debug = [ "esp32?/impl-register-debug", diff --git a/esp-hal/src/system.rs b/esp-hal/src/system.rs index cca5b43d92a..8e8e4395c25 100755 --- a/esp-hal/src/system.rs +++ b/esp-hal/src/system.rs @@ -292,9 +292,10 @@ impl InterruptConfigurable for SoftwareInterrupt { #[cfg_attr( multi_core, doc = r#" + Please note: Software interrupt 3 is reserved -for inter-processor communication when the `embassy` -feature is enabled."# +for inter-processor communication when using +`esp-hal-embassy`."# )] #[non_exhaustive] pub struct SoftwareInterruptControl { @@ -304,7 +305,9 @@ pub struct SoftwareInterruptControl { pub software_interrupt1: SoftwareInterrupt<1>, /// Software interrupt 2. pub software_interrupt2: SoftwareInterrupt<2>, - /// Software interrupt 3. + #[cfg(not(all(feature = "__esp_hal_embassy", multi_core)))] + /// Software interrupt 3. Only available when not using `esp-hal-embassy`, + /// or on single-core systems. pub software_interrupt3: SoftwareInterrupt<3>, }