Add embassy-embedded-hal nightly feature

This commit is contained in:
Henrik Alsér
2022-07-09 23:41:02 +02:00
parent 880b71a1e8
commit baae64d911
6 changed files with 11 additions and 3 deletions

View File

@ -5,6 +5,8 @@ edition = "2021"
[features]
std = []
# Enable nightly-only features
nightly = ["embedded-hal-async"]
[dependencies]
embassy = { version = "0.1.0", path = "../embassy" }

View File

@ -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<BUS::Error>;
}
#[cfg(feature = "nightly")]
impl<M, BUS> i2c::I2c for I2cBusDevice<'_, M, BUS>
where
M: RawMutex + 'static,
@ -139,6 +141,7 @@ where
type Error = I2cBusDeviceError<BUS::Error>;
}
#[cfg(feature = "nightly")]
impl<M, BUS> i2c::I2c for I2cBusDeviceWithConfig<'_, M, BUS>
where
M: RawMutex + 'static,

View File

@ -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<BUS::Error, CS::Error>;
}
#[cfg(feature = "nightly")]
impl<M, BUS, CS> spi::SpiDevice for SpiBusDevice<'_, M, BUS, CS>
where
M: RawMutex + 'static,
@ -133,6 +135,7 @@ where
type Error = SpiBusDeviceError<BUS::Error, CS::Error>;
}
#[cfg(feature = "nightly")]
impl<M, BUS, CS> spi::SpiDevice for SpiBusDeviceWithConfig<'_, M, BUS, CS>
where
M: RawMutex + 'static,