mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 21:11:31 +11:00
Fixed compile errors on eh1_0_alpha feature
This commit is contained in:
parent
a8a27672b8
commit
84b8fb05b0
|
@ -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<S: State, D: UartDevice, P: ValidUartPinout<D>> {
|
||||
device: D,
|
||||
|
|
|
@ -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 {}
|
||||
|
||||
|
|
Loading…
Reference in a new issue