Merge pull request #1892 from cumthugo/usart-not-wakeup

stm32/usart: fix read_until_idle not wake up issue
This commit is contained in:
xoviat 2023-09-13 17:29:13 +00:00 committed by GitHub
commit 9c647dd0e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -545,6 +545,13 @@ impl<'d, T: BasicInstance, RxDma> UartRx<'d, T, RxDma> {
unsafe { rdr(r).read_volatile() };
clear_interrupt_flags(r, sr);
if enable_idle_line_detection {
// enable idle interrupt
r.cr1().modify(|w| {
w.set_idleie(true);
});
}
compiler_fence(Ordering::SeqCst);
let has_errors = sr.pe() || sr.fe() || sr.ne() || sr.ore();