Merge pull request #3299 from badrbouslikhin/main

fix(stm32): disable transmitter during during half-duplex flush
This commit is contained in:
Dario Nieuwenhuis 2024-10-13 20:10:16 +00:00 committed by GitHub
commit 2f6273bb5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -535,9 +535,12 @@ fn blocking_flush(info: &Info) -> Result<(), Error> {
let r = info.regs; let r = info.regs;
while !sr(r).read().tc() {} while !sr(r).read().tc() {}
// Enable Receiver after transmission complete for Half-Duplex mode // Disable Transmitter and enable receiver after transmission complete for Half-Duplex mode
if r.cr3().read().hdsel() { if r.cr3().read().hdsel() {
r.cr1().modify(|reg| reg.set_re(true)); r.cr1().modify(|reg| {
reg.set_te(false);
reg.set_re(true);
});
} }
Ok(()) Ok(())