Update to embedded-io 0.5 (#1752)

This commit is contained in:
Dario Nieuwenhuis
2023-08-07 13:43:09 +02:00
committed by GitHub
parent 77844e2055
commit 5d5cd23715
52 changed files with 149 additions and 155 deletions

View File

@ -23,7 +23,7 @@ target = "thumbv7em-none-eabi"
features = ["nightly"]
[features]
nightly = ["embedded-io/async"]
nightly = ["dep:embedded-io-async"]
std = []
turbowakers = []
@ -35,7 +35,7 @@ futures-util = { version = "0.3.17", default-features = false }
critical-section = "1.1"
heapless = "0.7.5"
cfg-if = "1.0.0"
embedded-io = "0.4.0"
embedded-io-async = { version = "0.5.0", optional = true }
[dev-dependencies]
futures-executor = { version = "0.3.17", features = [ "thread-pool" ] }

View File

@ -381,17 +381,17 @@ mod io_impls {
use super::*;
impl<M: RawMutex, const N: usize> embedded_io::Io for Pipe<M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Pipe<M, N> {
type Error = Infallible;
}
impl<M: RawMutex, const N: usize> embedded_io::asynch::Read for Pipe<M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::Read for Pipe<M, N> {
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
Ok(Pipe::read(self, buf).await)
}
}
impl<M: RawMutex, const N: usize> embedded_io::asynch::Write for Pipe<M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::Write for Pipe<M, N> {
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
Ok(Pipe::write(self, buf).await)
}
@ -401,17 +401,17 @@ mod io_impls {
}
}
impl<M: RawMutex, const N: usize> embedded_io::Io for &Pipe<M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for &Pipe<M, N> {
type Error = Infallible;
}
impl<M: RawMutex, const N: usize> embedded_io::asynch::Read for &Pipe<M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::Read for &Pipe<M, N> {
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
Ok(Pipe::read(self, buf).await)
}
}
impl<M: RawMutex, const N: usize> embedded_io::asynch::Write for &Pipe<M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::Write for &Pipe<M, N> {
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
Ok(Pipe::write(self, buf).await)
}
@ -421,21 +421,21 @@ mod io_impls {
}
}
impl<M: RawMutex, const N: usize> embedded_io::Io for Reader<'_, M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Reader<'_, M, N> {
type Error = Infallible;
}
impl<M: RawMutex, const N: usize> embedded_io::asynch::Read for Reader<'_, M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::Read for Reader<'_, M, N> {
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
Ok(Reader::read(self, buf).await)
}
}
impl<M: RawMutex, const N: usize> embedded_io::Io for Writer<'_, M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::ErrorType for Writer<'_, M, N> {
type Error = Infallible;
}
impl<M: RawMutex, const N: usize> embedded_io::asynch::Write for Writer<'_, M, N> {
impl<M: RawMutex, const N: usize> embedded_io_async::Write for Writer<'_, M, N> {
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
Ok(Writer::write(self, buf).await)
}