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