File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ pub use uart_it::*;
55mod uart_poll;
66pub use uart_poll:: * ;
77
8+ use core:: fmt:: Display ;
89use embedded_hal_nb as e_nb;
910use 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+
97113impl embedded_io:: Error for Error {
98114 #[ inline]
99115 fn kind ( & self ) -> e_io:: ErrorKind {
You can’t perform that action at this time.
0 commit comments