Skip to content

Commit

Permalink
Eliminate esp-hal's embedded-io feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebraham committed Sep 3, 2024
1 parent 96a3217 commit ae37ae1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
7 changes: 2 additions & 5 deletions esp-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ embedded-hal-02 = { version = "0.2.7", features = ["unproven"], package
embedded-hal = "1.0.0"
embedded-hal-async = { version = "1.0.0", optional = true }
embedded-hal-nb = "1.0.0"
embedded-io = { version = "0.6.1", optional = true }
embedded-io = "0.6.1"
embedded-io-async = { version = "0.6.1", optional = true }
enumset = "1.1.5"
esp-synopsys-usb-otg = { version = "0.4.2", optional = true, features = ["fs", "esp32sx"] }
Expand Down Expand Up @@ -129,7 +129,6 @@ flip-link = ["esp-riscv-rt/fix-sp"]
## Also enables `embassy-usb` support for ESP32-S2 and ESP32-S3.
async = [
"embedded-hal-async",
"embedded-io",
"embedded-io-async",
"embassy-sync",
"embassy-futures",
Expand All @@ -152,8 +151,6 @@ defmt = [
"esp32s2?/defmt",
"esp32s3?/defmt",
]
## Implement the traits defined in `embedded-io` for certain peripherals.
embedded-io = ["dep:embedded-io"]

#! ### PSRAM Feature Flags
## Use externally connected PSRAM (2MB).
Expand All @@ -176,7 +173,7 @@ opsram-8m = []
opsram-16m = []

# This feature is intended for testing; you probably don't want to enable it:
ci = ["async", "embedded-io", "defmt", "bluetooth", "place-spi-driver-in-ram"]
ci = ["async", "defmt", "bluetooth", "place-spi-driver-in-ram"]

[lints.clippy]
mixed_attributes_style = "allow"
Expand Down
10 changes: 0 additions & 10 deletions esp-hal/src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ impl embedded_hal_nb::serial::Error for Error {
}
}

#[cfg(feature = "embedded-io")]
impl embedded_io::Error for Error {
fn kind(&self) -> embedded_io::ErrorKind {
embedded_io::ErrorKind::Other
Expand Down Expand Up @@ -1833,22 +1832,18 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::ErrorType for Uart<'_, T, M> {
type Error = Error;
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::ErrorType for UartTx<'_, T, M> {
type Error = Error;
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::ErrorType for UartRx<'_, T, M> {
type Error = Error;
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::Read for Uart<'_, T, M>
where
T: Instance,
Expand All @@ -1859,7 +1854,6 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::Read for UartRx<'_, T, M>
where
T: Instance,
Expand All @@ -1878,7 +1872,6 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::ReadReady for Uart<'_, T, M>
where
T: Instance,
Expand All @@ -1889,7 +1882,6 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::ReadReady for UartRx<'_, T, M>
where
T: Instance,
Expand All @@ -1900,7 +1892,6 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::Write for Uart<'_, T, M>
where
T: Instance,
Expand All @@ -1915,7 +1906,6 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<T, M> embedded_io::Write for UartTx<'_, T, M>
where
T: Instance,
Expand Down
7 changes: 0 additions & 7 deletions esp-hal/src/usb_serial_jtag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,31 +580,27 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<M> embedded_io::ErrorType for UsbSerialJtag<'_, M>
where
M: Mode,
{
type Error = Error;
}

#[cfg(feature = "embedded-io")]
impl<M> embedded_io::ErrorType for UsbSerialJtagTx<'_, M>
where
M: Mode,
{
type Error = Error;
}

#[cfg(feature = "embedded-io")]
impl<M> embedded_io::ErrorType for UsbSerialJtagRx<'_, M>
where
M: Mode,
{
type Error = Error;
}

#[cfg(feature = "embedded-io")]
impl<M> embedded_io::Read for UsbSerialJtag<'_, M>
where
M: Mode,
Expand All @@ -614,7 +610,6 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<M> embedded_io::Read for UsbSerialJtagRx<'_, M>
where
M: Mode,
Expand All @@ -629,7 +624,6 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<M> embedded_io::Write for UsbSerialJtag<'_, M>
where
M: Mode,
Expand All @@ -643,7 +637,6 @@ where
}
}

#[cfg(feature = "embedded-io")]
impl<M> embedded_io::Write for UsbSerialJtagTx<'_, M>
where
M: Mode,
Expand Down

0 comments on commit ae37ae1

Please sign in to comment.