forked from M-Labs/zynq-rs
1
0
Fork 0

libboard_zynq::flash: move man_start_com(true) into wait_tx_fifo_flush()

This commit is contained in:
Astro 2019-12-22 03:13:38 +01:00
parent 6c4b07e0cf
commit da60be38b1
2 changed files with 1 additions and 2 deletions

View File

@ -120,6 +120,7 @@ impl<MODE> Flash<MODE> {
}
fn wait_tx_fifo_flush(&mut self) {
self.regs.config.modify(|_, w| w.man_start_com(true));
while !self.regs.intr_status.read().tx_fifo_not_full() {}
}
}

View File

@ -47,7 +47,6 @@ impl<'a, Args: Iterator<Item = W>, W: Into<SpiWord>> Transfer<'a, Args, W> {
_ => {
if !self.flash.regs.intr_status.read().tx_fifo_not_full() {
// Flush if necessary
self.flash.regs.config.modify(|_, w| w.man_start_com(true));
self.flash.wait_tx_fifo_flush();
}
@ -74,7 +73,6 @@ impl<'a, Args: Iterator<Item = W>, W: Into<SpiWord>> Transfer<'a, Args, W> {
SpiWord::W32(_) => unreachable!(),
}
self.flash.regs.config.modify(|_, w| w.man_start_com(true));
self.flash.wait_tx_fifo_flush();
}
}