From 0f666c570c1d7e8a748427d3ebc67ccd78b177b7 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 2 May 2020 23:30:45 +0200 Subject: [PATCH] libboard_zynq: remove unneeded Uart flush --- libboard_zynq/src/uart/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libboard_zynq/src/uart/mod.rs b/libboard_zynq/src/uart/mod.rs index 12ce557..d7e376e 100644 --- a/libboard_zynq/src/uart/mod.rs +++ b/libboard_zynq/src/uart/mod.rs @@ -192,15 +192,14 @@ impl Uart { self.regs.channel_sts.read().txfull() } - pub fn tx_fifo_empty(&self) -> bool { - self.regs.channel_sts.read().txempty() + pub fn tx_idle(&self) -> bool { + let status = self.regs.channel_sts.read(); + status.txempty() && !status.tactive() } } impl fmt::Write for Uart { fn write_str(&mut self, s: &str) -> Result<(), fmt::Error> { - while !self.tx_fifo_empty() {} - for b in s.bytes() { self.write_byte(b); }