Skip to content

Commit fa96c9f

Browse files
committed
Update embedded-io
1 parent 45eef6a commit fa96c9f

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
5353
sync-code = "0.1.1"
5454

5555
[dependencies]
56-
bitflags = "2.9"
56+
bitflags = "2"
5757
cfg-if = "1.0"
5858
cortex-m = { version = "0.7", optional = true }
5959
cortex-m-rt = { version = "0.7", optional = true }
6060
critical-section = "1.2"
6161
embedded-dma = "0.2"
6262
embedded-hal = "1.0"
6363
embedded-hal-nb = "1.0"
64-
embedded-io = "0.6"
64+
embedded-io = "0.7"
6565
fugit = "0.3"
6666
fugit-timer = "0.1"
6767
nb = "1.1"

src/common/uart/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub use uart_it::*;
55
mod uart_poll;
66
pub use uart_poll::*;
77

8+
use core::fmt::Display;
89
use embedded_hal_nb as e_nb;
910
use embedded_io as e_io;
1011

@@ -94,6 +95,21 @@ pub enum Error {
9495
Other,
9596
}
9697

98+
impl Display for Error {
99+
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
100+
match self {
101+
Error::Overrun => write!(f, "UART overrun error"),
102+
Error::FrameFormat => write!(f, "UART frame format error"),
103+
Error::Parity => write!(f, "UART parity error"),
104+
Error::Noise => write!(f, "UART noise error"),
105+
Error::Busy => write!(f, "UART busy"),
106+
Error::Other => write!(f, "UART other error"),
107+
}
108+
}
109+
}
110+
111+
impl core::error::Error for Error {}
112+
97113
impl embedded_io::Error for Error {
98114
#[inline]
99115
fn kind(&self) -> e_io::ErrorKind {

0 commit comments

Comments
 (0)