diff options
| author | Henrik Alsér <[email protected]> | 2022-07-09 23:41:02 +0200 |
|---|---|---|
| committer | Henrik Alsér <[email protected]> | 2022-07-09 23:41:02 +0200 |
| commit | baae64d911d6f2bd2560b64b3856471b390f41cd (patch) | |
| tree | a1818b56b817bd5f0897daf6ff372a48ce006231 /embassy-embedded-hal/src/shared_bus | |
| parent | 880b71a1e8246011109d64794ec98477722bde0e (diff) | |
Add embassy-embedded-hal nightly feature
Diffstat (limited to 'embassy-embedded-hal/src/shared_bus')
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/i2c.rs | 3 | ||||
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/spi.rs | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/i2c.rs b/embassy-embedded-hal/src/shared_bus/i2c.rs index 18f144531..f63190e6a 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; | |||
| 27 | 27 | ||
| 28 | use embassy::blocking_mutex::raw::RawMutex; | 28 | use embassy::blocking_mutex::raw::RawMutex; |
| 29 | use embassy::mutex::Mutex; | 29 | use embassy::mutex::Mutex; |
| 30 | #[cfg(feature = "nightly")] | ||
| 30 | use embedded_hal_async::i2c; | 31 | use embedded_hal_async::i2c; |
| 31 | 32 | ||
| 32 | use crate::SetConfig; | 33 | use crate::SetConfig; |
| @@ -64,6 +65,7 @@ where | |||
| 64 | type Error = I2cBusDeviceError<BUS::Error>; | 65 | type Error = I2cBusDeviceError<BUS::Error>; |
| 65 | } | 66 | } |
| 66 | 67 | ||
| 68 | #[cfg(feature = "nightly")] | ||
| 67 | impl<M, BUS> i2c::I2c for I2cBusDevice<'_, M, BUS> | 69 | impl<M, BUS> i2c::I2c for I2cBusDevice<'_, M, BUS> |
| 68 | where | 70 | where |
| 69 | M: RawMutex + 'static, | 71 | M: RawMutex + 'static, |
| @@ -139,6 +141,7 @@ where | |||
| 139 | type Error = I2cBusDeviceError<BUS::Error>; | 141 | type Error = I2cBusDeviceError<BUS::Error>; |
| 140 | } | 142 | } |
| 141 | 143 | ||
| 144 | #[cfg(feature = "nightly")] | ||
| 142 | impl<M, BUS> i2c::I2c for I2cBusDeviceWithConfig<'_, M, BUS> | 145 | impl<M, BUS> i2c::I2c for I2cBusDeviceWithConfig<'_, M, BUS> |
| 143 | where | 146 | where |
| 144 | M: RawMutex + 'static, | 147 | M: RawMutex + 'static, |
diff --git a/embassy-embedded-hal/src/shared_bus/spi.rs b/embassy-embedded-hal/src/shared_bus/spi.rs index 8e3762e68..136352e0a 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; | |||
| 32 | use embassy::mutex::Mutex; | 32 | use embassy::mutex::Mutex; |
| 33 | use embedded_hal_1::digital::blocking::OutputPin; | 33 | use embedded_hal_1::digital::blocking::OutputPin; |
| 34 | use embedded_hal_1::spi::ErrorType; | 34 | use embedded_hal_1::spi::ErrorType; |
| 35 | #[cfg(feature = "nightly")] | ||
| 35 | use embedded_hal_async::spi; | 36 | use embedded_hal_async::spi; |
| 36 | 37 | ||
| 37 | use crate::SetConfig; | 38 | use crate::SetConfig; |
| @@ -74,6 +75,7 @@ where | |||
| 74 | type Error = SpiBusDeviceError<BUS::Error, CS::Error>; | 75 | type Error = SpiBusDeviceError<BUS::Error, CS::Error>; |
| 75 | } | 76 | } |
| 76 | 77 | ||
| 78 | #[cfg(feature = "nightly")] | ||
| 77 | impl<M, BUS, CS> spi::SpiDevice for SpiBusDevice<'_, M, BUS, CS> | 79 | impl<M, BUS, CS> spi::SpiDevice for SpiBusDevice<'_, M, BUS, CS> |
| 78 | where | 80 | where |
| 79 | M: RawMutex + 'static, | 81 | M: RawMutex + 'static, |
| @@ -133,6 +135,7 @@ where | |||
| 133 | type Error = SpiBusDeviceError<BUS::Error, CS::Error>; | 135 | type Error = SpiBusDeviceError<BUS::Error, CS::Error>; |
| 134 | } | 136 | } |
| 135 | 137 | ||
| 138 | #[cfg(feature = "nightly")] | ||
| 136 | impl<M, BUS, CS> spi::SpiDevice for SpiBusDeviceWithConfig<'_, M, BUS, CS> | 139 | impl<M, BUS, CS> spi::SpiDevice for SpiBusDeviceWithConfig<'_, M, BUS, CS> |
| 137 | where | 140 | where |
| 138 | M: RawMutex + 'static, | 141 | M: RawMutex + 'static, |
