diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index d1b9f3ea..15d3beb2 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml @@ -5,6 +5,8 @@ edition = "2021" [features] std = [] +# Enable nightly-only features +nightly = ["embedded-hal-async"] [dependencies] embassy = { version = "0.1.0", path = "../embassy" } diff --git a/embassy-embedded-hal/src/shared_bus/i2c.rs b/embassy-embedded-hal/src/shared_bus/i2c.rs index 18f14453..f63190e6 100644 --- a/embassy-embedded-hal/src/shared_bus/i2c.rs +++ b/embassy-embedded-hal/src/shared_bus/i2c.rs @@ -27,6 +27,7 @@ use core::future::Future; use embassy::blocking_mutex::raw::RawMutex; use embassy::mutex::Mutex; +#[cfg(feature = "nightly")] use embedded_hal_async::i2c; use crate::SetConfig; @@ -64,6 +65,7 @@ where type Error = I2cBusDeviceError; } +#[cfg(feature = "nightly")] impl i2c::I2c for I2cBusDevice<'_, M, BUS> where M: RawMutex + 'static, @@ -139,6 +141,7 @@ where type Error = I2cBusDeviceError; } +#[cfg(feature = "nightly")] impl i2c::I2c for I2cBusDeviceWithConfig<'_, M, BUS> where M: RawMutex + 'static, diff --git a/embassy-embedded-hal/src/shared_bus/spi.rs b/embassy-embedded-hal/src/shared_bus/spi.rs index 8e3762e6..136352e0 100644 --- a/embassy-embedded-hal/src/shared_bus/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/spi.rs @@ -32,6 +32,7 @@ use embassy::blocking_mutex::raw::RawMutex; use embassy::mutex::Mutex; use embedded_hal_1::digital::blocking::OutputPin; use embedded_hal_1::spi::ErrorType; +#[cfg(feature = "nightly")] use embedded_hal_async::spi; use crate::SetConfig; @@ -74,6 +75,7 @@ where type Error = SpiBusDeviceError; } +#[cfg(feature = "nightly")] impl spi::SpiDevice for SpiBusDevice<'_, M, BUS, CS> where M: RawMutex + 'static, @@ -133,6 +135,7 @@ where type Error = SpiBusDeviceError; } +#[cfg(feature = "nightly")] impl spi::SpiDevice for SpiBusDeviceWithConfig<'_, M, BUS, CS> where M: RawMutex + 'static, diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index 3f9dabbb..3569a70c 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml @@ -21,7 +21,7 @@ time = ["embassy/time"] defmt = ["dep:defmt", "embassy/defmt", "embassy-usb?/defmt", "embedded-io?/defmt"] # Enable nightly-only features -nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-usb", "embedded-storage-async", "dep:embedded-io"] +nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-usb", "embedded-storage-async", "dep:embedded-io", "embassy-embedded-hal/nightly"] # Reexport the PAC for the currently enabled chip at `embassy_nrf::pac`. # This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version. diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 0a278ab0..95ae76cd 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml @@ -20,7 +20,7 @@ flavors = [ unstable-pac = [] # Enable nightly-only features -nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async"] +nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly"] # Implement embedded-hal 1.0 alpha traits. # Implement embedded-hal-async traits if `nightly` is set as well. diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 547aad02..a5c444fb 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml @@ -91,7 +91,7 @@ time-driver-tim12 = ["_time-driver"] time-driver-tim15 = ["_time-driver"] # Enable nightly-only features -nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "dep:embedded-io", "dep:embassy-usb"] +nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "dep:embedded-io", "dep:embassy-usb", "embassy-embedded-hal/nightly"] # Reexport stm32-metapac at `embassy_stm32::pac`. # This is unstable because semver-minor (non-breaking) releases of embassy-stm32 may major-bump (breaking) the stm32-metapac version.