From da60be38b1573db92fd3f936a5951d6c2bdeea5c Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 22 Dec 2019 03:13:38 +0100 Subject: [PATCH] libboard_zynq::flash: move man_start_com(true) into wait_tx_fifo_flush() --- libboard_zynq/src/flash/mod.rs | 1 + libboard_zynq/src/flash/transfer.rs | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libboard_zynq/src/flash/mod.rs b/libboard_zynq/src/flash/mod.rs index 4dd42aa..d40568b 100644 --- a/libboard_zynq/src/flash/mod.rs +++ b/libboard_zynq/src/flash/mod.rs @@ -120,6 +120,7 @@ impl Flash { } 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() {} } } diff --git a/libboard_zynq/src/flash/transfer.rs b/libboard_zynq/src/flash/transfer.rs index 6d761a8..53f0996 100644 --- a/libboard_zynq/src/flash/transfer.rs +++ b/libboard_zynq/src/flash/transfer.rs @@ -47,7 +47,6 @@ impl<'a, Args: Iterator, W: Into> 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, W: Into> Transfer<'a, Args, W> { SpiWord::W32(_) => unreachable!(), } - self.flash.regs.config.modify(|_, w| w.man_start_com(true)); self.flash.wait_tx_fifo_flush(); } }