Open svartalf opened 4 years ago
According to the "27.6.1 Status register (USART_SR)" of the reference manual in case if error flag bit is set during the read, software needs to clear it by reading SR and DR registers.
Basically it is a copy of the stm32f1xx-hal lib Serial::read implementation: https://github.com/stm32-rs/stm32f1xx-hal/blob/e36195ed3ea4512ffe5fa0683d7cc510e54cc4b5/src/serial.rs#L348-L388 , but since I'm not an expert in an embedded field, it would be nice to check it once again.
stm32f1xx-hal
Serial::read
According to the "27.6.1 Status register (USART_SR)" of the reference manual in case if error flag bit is set during the read, software needs to clear it by reading SR and DR registers.
Basically it is a copy of the
stm32f1xx-hal
libSerial::read
implementation: https://github.com/stm32-rs/stm32f1xx-hal/blob/e36195ed3ea4512ffe5fa0683d7cc510e54cc4b5/src/serial.rs#L348-L388 , but since I'm not an expert in an embedded field, it would be nice to check it once again.