diff options
Diffstat (limited to 'embassy-embedded-hal/src/adapter/blocking_async.rs')
| -rw-r--r-- | embassy-embedded-hal/src/adapter/blocking_async.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/embassy-embedded-hal/src/adapter/blocking_async.rs b/embassy-embedded-hal/src/adapter/blocking_async.rs index bc965fbdd..3b6e0ec00 100644 --- a/embassy-embedded-hal/src/adapter/blocking_async.rs +++ b/embassy-embedded-hal/src/adapter/blocking_async.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | use embedded_hal_02::blocking; | ||
| 2 | |||
| 3 | /// Wrapper that implements async traits using blocking implementations. | 1 | /// Wrapper that implements async traits using blocking implementations. |
| 4 | /// | 2 | /// |
| 5 | /// This allows driver writers to depend on the async traits while still supporting embedded-hal peripheral implementations. | 3 | /// This allows driver writers to depend on the async traits while still supporting embedded-hal peripheral implementations. |
| @@ -24,7 +22,7 @@ impl<T> BlockingAsync<T> { | |||
| 24 | impl<T, E> embedded_hal_1::i2c::ErrorType for BlockingAsync<T> | 22 | impl<T, E> embedded_hal_1::i2c::ErrorType for BlockingAsync<T> |
| 25 | where | 23 | where |
| 26 | E: embedded_hal_1::i2c::Error + 'static, | 24 | E: embedded_hal_1::i2c::Error + 'static, |
| 27 | T: blocking::i2c::WriteRead<Error = E> + blocking::i2c::Read<Error = E> + blocking::i2c::Write<Error = E>, | 25 | T: embedded_hal_1::i2c::I2c<Error = E>, |
| 28 | { | 26 | { |
| 29 | type Error = E; | 27 | type Error = E; |
| 30 | } | 28 | } |
| @@ -32,7 +30,7 @@ where | |||
| 32 | impl<T, E> embedded_hal_async::i2c::I2c for BlockingAsync<T> | 30 | impl<T, E> embedded_hal_async::i2c::I2c for BlockingAsync<T> |
| 33 | where | 31 | where |
| 34 | E: embedded_hal_1::i2c::Error + 'static, | 32 | E: embedded_hal_1::i2c::Error + 'static, |
| 35 | T: blocking::i2c::WriteRead<Error = E> + blocking::i2c::Read<Error = E> + blocking::i2c::Write<Error = E>, | 33 | T: embedded_hal_1::i2c::I2c<Error = E>, |
| 36 | { | 34 | { |
| 37 | async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { | 35 | async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), Self::Error> { |
| 38 | self.wrapped.read(address, read) | 36 | self.wrapped.read(address, read) |
| @@ -51,9 +49,7 @@ where | |||
| 51 | address: u8, | 49 | address: u8, |
| 52 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], | 50 | operations: &mut [embedded_hal_1::i2c::Operation<'_>], |
| 53 | ) -> Result<(), Self::Error> { | 51 | ) -> Result<(), Self::Error> { |
| 54 | let _ = address; | 52 | self.wrapped.transaction(address, operations) |
| 55 | let _ = operations; | ||
| 56 | todo!() | ||
| 57 | } | 53 | } |
| 58 | } | 54 | } |
| 59 | 55 | ||
