rp/spi: properly drain the rx buffer while writing

This commit is contained in:
Dario Nieuwenhuis 2021-07-20 09:42:52 +02:00
parent 1799938187
commit dbff5cc232

View File

@ -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();
}