mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 14:22:33 +00:00
Merge pull request #3299 from badrbouslikhin/main
fix(stm32): disable transmitter during during half-duplex flush
This commit is contained in:
commit
2f6273bb5d
@ -535,9 +535,12 @@ fn blocking_flush(info: &Info) -> Result<(), Error> {
|
||||
let r = info.regs;
|
||||
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() {
|
||||
r.cr1().modify(|reg| reg.set_re(true));
|
||||
r.cr1().modify(|reg| {
|
||||
reg.set_te(false);
|
||||
reg.set_re(true);
|
||||
});
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user