From 3070a2fac1637e6ceed726fd4a79d85ec07133e3 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 3 Mar 2017 05:15:54 +0000 Subject: [PATCH] runtime: fix more bugs in DMA trace encoder. --- artiq/firmware/runtime/rtio_dma.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/runtime/rtio_dma.rs b/artiq/firmware/runtime/rtio_dma.rs index f372a740c..ad92ab877 100644 --- a/artiq/firmware/runtime/rtio_dma.rs +++ b/artiq/firmware/runtime/rtio_dma.rs @@ -51,13 +51,19 @@ impl Manager { (address >> 8) as u8, ]).unwrap(); for &word in data { - writer.write_u32(word).unwrap(); + writer.write_all(&[ + (word >> 0) as u8, + (word >> 8) as u8, + (word >> 16) as u8, + (word >> 24) as u8, + ]).unwrap(); } } pub fn record_stop(&mut self, name: &str) { let mut recorded = Vec::new(); mem::swap(&mut self.recording, &mut recorded); + recorded.push(0); recorded.shrink_to_fit(); info!("recorded DMA data: {:?}", recorded);