Skip to content

Commit d62969b

Browse files
committed
serial
1 parent d66dd86 commit d62969b

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/serial.rs

+3-13
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ use crate::rcc::{BusClock, Clocks, Enable, Reset};
7575
use crate::time::{Bps, U32Ext};
7676

7777
mod hal_02;
78+
mod hal_1;
7879

7980
// USART REMAPPING, see: https://www.st.com/content/ccc/resource/technical/document/reference_manual/59/b9/ba/7f/11/af/43/d5/CD00171190.pdf/files/CD00171190.pdf/jcr:content/translations/en.CD00171190.pdf
8081
// Section 9.3.8
@@ -134,18 +135,7 @@ inst! {
134135
}
135136

136137
/// Serial error
137-
#[derive(Debug)]
138-
#[non_exhaustive]
139-
pub enum Error {
140-
/// Framing error
141-
Framing,
142-
/// Noise error
143-
Noise,
144-
/// RX buffer overrun
145-
Overrun,
146-
/// Parity check error
147-
Parity,
148-
}
138+
pub use embedded_hal_one::serial::ErrorKind as Error;
149139

150140
pub enum WordLength {
151141
/// When parity is enabled, a word has 7 data bits + 1 parity bit,
@@ -514,7 +504,7 @@ impl<USART: Instance> Rx<USART> {
514504
let err = if sr.pe().bit_is_set() {
515505
Some(Error::Parity)
516506
} else if sr.fe().bit_is_set() {
517-
Some(Error::Framing)
507+
Some(Error::FrameFormat)
518508
} else if sr.ne().bit_is_set() {
519509
Some(Error::Noise)
520510
} else if sr.ore().bit_is_set() {

0 commit comments

Comments
 (0)