From 84b8fb05b032df985194f346ab7e60f5e7d05cf7 Mon Sep 17 00:00:00 2001 From: Victor Koenders Date: Sat, 27 Nov 2021 13:09:11 +0100 Subject: [PATCH] Fixed compile errors on eh1_0_alpha feature --- rp2040-hal/src/uart/peripheral.rs | 12 ------------ rp2040-hal/src/uart/utils.rs | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rp2040-hal/src/uart/peripheral.rs b/rp2040-hal/src/uart/peripheral.rs index 2845cb7..385342c 100644 --- a/rp2040-hal/src/uart/peripheral.rs +++ b/rp2040-hal/src/uart/peripheral.rs @@ -40,18 +40,6 @@ use embedded_time::rate::Baud; use embedded_time::rate::Hertz; use nb::Error::{Other, WouldBlock}; -#[cfg(feature = "eh1_0_alpha")] -impl eh1_0_alpha::serial::Error for ReadErrorType { - fn kind(&self) -> eh1_0_alpha::serial::ErrorKind { - match self { - ReadErrorType::Overrun => eh1_0_alpha::serial::ErrorKind::Overrun, - ReadErrorType::Break => eh1_0_alpha::serial::ErrorKind::Other, - ReadErrorType::Parity => eh1_0_alpha::serial::ErrorKind::Parity, - ReadErrorType::Framing => eh1_0_alpha::serial::ErrorKind::FrameFormat, - } - } -} - /// An UART Peripheral based on an underlying UART device. pub struct UartPeripheral> { device: D, diff --git a/rp2040-hal/src/uart/utils.rs b/rp2040-hal/src/uart/utils.rs index 36b125f..8997b7c 100644 --- a/rp2040-hal/src/uart/utils.rs +++ b/rp2040-hal/src/uart/utils.rs @@ -35,6 +35,18 @@ pub enum ReadErrorType { Framing, } +#[cfg(feature = "eh1_0_alpha")] +impl eh1_0_alpha::serial::Error for ReadErrorType { + fn kind(&self) -> eh1_0_alpha::serial::ErrorKind { + match self { + ReadErrorType::Overrun => eh1_0_alpha::serial::ErrorKind::Overrun, + ReadErrorType::Break => eh1_0_alpha::serial::ErrorKind::Other, + ReadErrorType::Parity => eh1_0_alpha::serial::ErrorKind::Parity, + ReadErrorType::Framing => eh1_0_alpha::serial::ErrorKind::FrameFormat, + } + } +} + /// State of the UART Peripheral. pub trait State {}