From 0d8bad512847def1147c105f9905c074d721ecba Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 3 Nov 2017 09:25:37 +0800 Subject: [PATCH] runtime: fix rtio::log --- artiq/firmware/ksupport/rtio.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/artiq/firmware/ksupport/rtio.rs b/artiq/firmware/ksupport/rtio.rs index 682a118c6..0c95842ad 100644 --- a/artiq/firmware/ksupport/rtio.rs +++ b/artiq/firmware/ksupport/rtio.rs @@ -140,16 +140,17 @@ pub fn log(timestamp: i64, data: &[u8]) { for i in 0..data.len() { word <<= 8; word |= data[i] as u32; - if i != 0 && i % 4 == 0 { + if i % 4 == 3 { rtio_o_data_write(0, word); csr::rtio::o_we_write(1); word = 0; } } - word <<= 8; - rtio_o_data_write(0, word); - csr::rtio::o_we_write(1); + if word != 0 { + rtio_o_data_write(0, word); + csr::rtio::o_we_write(1); + } } }