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