rp/spi: properly drain the rx buffer while writing
This commit is contained in:
parent
1799938187
commit
dbff5cc232
1 changed files with 2 additions and 0 deletions
|
@ -111,6 +111,8 @@ impl<'d, T: Instance> Spi<'d, T> {
|
|||
for &b in data {
|
||||
while !p.sr().read().tnf() {}
|
||||
p.dr().write(|w| w.set_data(b as _));
|
||||
while !p.sr().read().rne() {}
|
||||
let _ = p.dr().read();
|
||||
}
|
||||
self.flush();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue