diff --git a/esp-hal/src/uart.rs b/esp-hal/src/uart.rs index eb0c2139b..9a6007a89 100644 --- a/esp-hal/src/uart.rs +++ b/esp-hal/src/uart.rs @@ -1325,54 +1325,6 @@ impl embedded_hal_nb::serial::ErrorType for UartRx<'_, Dm> { type Error = Error; } -impl embedded_hal_nb::serial::Read for Uart<'_, Dm> -where - Dm: DriverMode, -{ - fn read(&mut self) -> embedded_hal_nb::nb::Result { - self.read_byte() - .ok_or(embedded_hal_nb::nb::Error::WouldBlock) - } -} - -impl embedded_hal_nb::serial::Read for UartRx<'_, Dm> -where - Dm: DriverMode, -{ - fn read(&mut self) -> embedded_hal_nb::nb::Result { - self.read_byte() - .ok_or(embedded_hal_nb::nb::Error::WouldBlock) - } -} - -impl embedded_hal_nb::serial::Write for Uart<'_, Dm> -where - Dm: DriverMode, -{ - fn write(&mut self, word: u8) -> embedded_hal_nb::nb::Result<(), Self::Error> { - self.write_byte(word) - .ok_or(embedded_hal_nb::nb::Error::WouldBlock) - } - - fn flush(&mut self) -> embedded_hal_nb::nb::Result<(), Self::Error> { - self.flush().ok_or(embedded_hal_nb::nb::Error::WouldBlock) - } -} - -impl embedded_hal_nb::serial::Write for UartTx<'_, Dm> -where - Dm: DriverMode, -{ - fn write(&mut self, word: u8) -> embedded_hal_nb::nb::Result<(), Self::Error> { - self.write_byte(word) - .ok_or(embedded_hal_nb::nb::Error::WouldBlock) - } - - fn flush(&mut self) -> embedded_hal_nb::nb::Result<(), Self::Error> { - self.flush().ok_or(embedded_hal_nb::nb::Error::WouldBlock) - } -} - #[cfg(any(doc, feature = "unstable"))] #[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] impl embedded_io::ErrorType for Uart<'_, Dm> {