Browse Source

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

master
Astro 2 years ago
parent
commit
da60be38b1
  1. 1
      libboard_zynq/src/flash/mod.rs
  2. 2
      libboard_zynq/src/flash/transfer.rs

1
libboard_zynq/src/flash/mod.rs

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

2
libboard_zynq/src/flash/transfer.rs

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

Loading…
Cancel
Save