diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-08-07 13:43:09 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-08-07 13:43:09 +0200 |
| commit | 5d5cd2371504915a531e669dce3558485a51a2e1 (patch) | |
| tree | 5d0093e9e5005d3a946e92686a9dc79565c3043f /embassy-sync | |
| parent | 77844e2055319e1af7dd50fdb2e39ef88c6a5010 (diff) | |
Update to embedded-io 0.5 (#1752)
Diffstat (limited to 'embassy-sync')
| -rw-r--r-- | embassy-sync/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-sync/src/pipe.rs | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/embassy-sync/Cargo.toml b/embassy-sync/Cargo.toml index 340724eab..94d6799e5 100644 --- a/embassy-sync/Cargo.toml +++ b/embassy-sync/Cargo.toml | |||
| @@ -23,7 +23,7 @@ target = "thumbv7em-none-eabi" | |||
| 23 | features = ["nightly"] | 23 | features = ["nightly"] |
| 24 | 24 | ||
| 25 | [features] | 25 | [features] |
| 26 | nightly = ["embedded-io/async"] | 26 | nightly = ["dep:embedded-io-async"] |
| 27 | std = [] | 27 | std = [] |
| 28 | turbowakers = [] | 28 | turbowakers = [] |
| 29 | 29 | ||
| @@ -35,7 +35,7 @@ futures-util = { version = "0.3.17", default-features = false } | |||
| 35 | critical-section = "1.1" | 35 | critical-section = "1.1" |
| 36 | heapless = "0.7.5" | 36 | heapless = "0.7.5" |
| 37 | cfg-if = "1.0.0" | 37 | cfg-if = "1.0.0" |
| 38 | embedded-io = "0.4.0" | 38 | embedded-io-async = { version = "0.5.0", optional = true } |
| 39 | 39 | ||
| 40 | [dev-dependencies] | 40 | [dev-dependencies] |
| 41 | futures-executor = { version = "0.3.17", features = [ "thread-pool" ] } | 41 | futures-executor = { version = "0.3.17", features = [ "thread-pool" ] } |
diff --git a/embassy-sync/src/pipe.rs b/embassy-sync/src/pipe.rs index 13bf4ef01..6e3e77b49 100644 --- a/embassy-sync/src/pipe.rs +++ b/embassy-sync/src/pipe.rs | |||
| @@ -381,17 +381,17 @@ mod io_impls { | |||
| 381 | 381 | ||
| 382 | use super::*; | 382 | use super::*; |
| 383 | 383 | ||
| 384 | impl<M: RawMutex, const N: usize> embedded_io::Io for Pipe<M, N> { | 384 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Pipe<M, N> { |
| 385 | type Error = Infallible; | 385 | type Error = Infallible; |
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | impl<M: RawMutex, const N: usize> embedded_io::asynch::Read for Pipe<M, N> { | 388 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for Pipe<M, N> { |
| 389 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 389 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| 390 | Ok(Pipe::read(self, buf).await) | 390 | Ok(Pipe::read(self, buf).await) |
| 391 | } | 391 | } |
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | impl<M: RawMutex, const N: usize> embedded_io::asynch::Write for Pipe<M, N> { | 394 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for Pipe<M, N> { |
| 395 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 395 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 396 | Ok(Pipe::write(self, buf).await) | 396 | Ok(Pipe::write(self, buf).await) |
| 397 | } | 397 | } |
| @@ -401,17 +401,17 @@ mod io_impls { | |||
| 401 | } | 401 | } |
| 402 | } | 402 | } |
| 403 | 403 | ||
| 404 | impl<M: RawMutex, const N: usize> embedded_io::Io for &Pipe<M, N> { | 404 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for &Pipe<M, N> { |
| 405 | type Error = Infallible; | 405 | type Error = Infallible; |
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | impl<M: RawMutex, const N: usize> embedded_io::asynch::Read for &Pipe<M, N> { | 408 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for &Pipe<M, N> { |
| 409 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 409 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| 410 | Ok(Pipe::read(self, buf).await) | 410 | Ok(Pipe::read(self, buf).await) |
| 411 | } | 411 | } |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | impl<M: RawMutex, const N: usize> embedded_io::asynch::Write for &Pipe<M, N> { | 414 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for &Pipe<M, N> { |
| 415 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 415 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 416 | Ok(Pipe::write(self, buf).await) | 416 | Ok(Pipe::write(self, buf).await) |
| 417 | } | 417 | } |
| @@ -421,21 +421,21 @@ mod io_impls { | |||
| 421 | } | 421 | } |
| 422 | } | 422 | } |
| 423 | 423 | ||
| 424 | impl<M: RawMutex, const N: usize> embedded_io::Io for Reader<'_, M, N> { | 424 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Reader<'_, M, N> { |
| 425 | type Error = Infallible; | 425 | type Error = Infallible; |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | impl<M: RawMutex, const N: usize> embedded_io::asynch::Read for Reader<'_, M, N> { | 428 | impl<M: RawMutex, const N: usize> embedded_io_async::Read for Reader<'_, M, N> { |
| 429 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 429 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| 430 | Ok(Reader::read(self, buf).await) | 430 | Ok(Reader::read(self, buf).await) |
| 431 | } | 431 | } |
| 432 | } | 432 | } |
| 433 | 433 | ||
| 434 | impl<M: RawMutex, const N: usize> embedded_io::Io for Writer<'_, M, N> { | 434 | impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Writer<'_, M, N> { |
| 435 | type Error = Infallible; | 435 | type Error = Infallible; |
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | impl<M: RawMutex, const N: usize> embedded_io::asynch::Write for Writer<'_, M, N> { | 438 | impl<M: RawMutex, const N: usize> embedded_io_async::Write for Writer<'_, M, N> { |
| 439 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 439 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 440 | Ok(Writer::write(self, buf).await) | 440 | Ok(Writer::write(self, buf).await) |
| 441 | } | 441 | } |
