mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 23:02:30 +00:00
Add back MISO flush
This commit is contained in:
parent
56bcc824e0
commit
f9ac0c8047
@ -14,6 +14,11 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> {
|
||||
T::regs().cr1().modify(|w| {
|
||||
w.set_spe(false);
|
||||
});
|
||||
|
||||
// Flush the read buffer to avoid errornous data from being read
|
||||
while T::regs().sr().read().rxne() {
|
||||
let _ = T::regs().dr().read();
|
||||
}
|
||||
}
|
||||
self.set_word_size(WordSize::EightBit);
|
||||
|
||||
|
@ -15,6 +15,11 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> {
|
||||
T::regs().cr1().modify(|w| {
|
||||
w.set_spe(false);
|
||||
});
|
||||
|
||||
// Flush the read buffer to avoid errornous data from being read
|
||||
while T::regs().sr().read().rxp() {
|
||||
let _ = T::regs().rxdr().read();
|
||||
}
|
||||
}
|
||||
|
||||
let request = self.txdma.request();
|
||||
|
Loading…
Reference in New Issue
Block a user