mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-26 03:06:32 +11:00
Fixed compile errors on eh1_0_alpha feature
This commit is contained in:
parent
a8a27672b8
commit
84b8fb05b0
2 changed files with 12 additions and 12 deletions
|
@ -40,18 +40,6 @@ use embedded_time::rate::Baud;
|
||||||
use embedded_time::rate::Hertz;
|
use embedded_time::rate::Hertz;
|
||||||
use nb::Error::{Other, WouldBlock};
|
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.
|
/// An UART Peripheral based on an underlying UART device.
|
||||||
pub struct UartPeripheral<S: State, D: UartDevice, P: ValidUartPinout<D>> {
|
pub struct UartPeripheral<S: State, D: UartDevice, P: ValidUartPinout<D>> {
|
||||||
device: D,
|
device: D,
|
||||||
|
|
|
@ -35,6 +35,18 @@ pub enum ReadErrorType {
|
||||||
Framing,
|
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.
|
/// State of the UART Peripheral.
|
||||||
pub trait State {}
|
pub trait State {}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue