From 582ef9099405947ae621e923ba40bd6fd3789285 Mon Sep 17 00:00:00 2001 From: cumthugo Date: Wed, 13 Sep 2023 00:18:18 +0800 Subject: [PATCH] stm32/usart: fix usart not wake up issue --- embassy-stm32/src/usart/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index bfb05671..2d744322 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs @@ -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();