Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear error flags on a serial read #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Clear error flags on a serial read #4

wants to merge 1 commit into from

Conversation

svartalf
Copy link

@svartalf svartalf commented Nov 14, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant