From c9bac028bf639630e299ea5b9ddada77a6de718b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 4 Aug 2020 13:14:00 +0800 Subject: [PATCH] dma: call rtio module to get time cursor position More portable across RTIO implementations. --- src/runtime/src/kernel/dma.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/src/kernel/dma.rs b/src/runtime/src/kernel/dma.rs index 024c4af1..9dcb6439 100644 --- a/src/runtime/src/kernel/dma.rs +++ b/src/runtime/src/kernel/dma.rs @@ -197,7 +197,7 @@ unsafe fn dma_record_output_prepare(timestamp: i64, target: i32, pub extern fn dma_record_output(target: i32, word: i32) { unsafe { - let timestamp = csr::rtio::now_read() as i64; + let timestamp = rtio::now_mu(); let data = dma_record_output_prepare(timestamp, target, 1); data.copy_from_slice(&[ (word >> 0) as u8, @@ -212,7 +212,7 @@ pub extern fn dma_record_output_wide(target: i32, words: CSlice) { assert!(words.len() <= 16); // enforce the hardware limit unsafe { - let timestamp = csr::rtio::now_read() as i64; + let timestamp = rtio::now_mu(); let mut data = dma_record_output_prepare(timestamp, target, words.len()); for word in words.as_ref().iter() { data[..4].copy_from_slice(&[