From 8cb6cf6094b5ad2d5a6177ee96b3a9ece3c61796 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Tue, 4 Apr 2023 16:46:52 +0100 Subject: [PATCH] Fix mismatched signatures for the wide interface Lists are passed by-reference from python code, and so should be &CSlice<_> not CSlice<_>. --- src/runtime/src/kernel/dma.rs | 2 +- src/runtime/src/rtio_csr.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/src/kernel/dma.rs b/src/runtime/src/kernel/dma.rs index af405d6..997625d 100644 --- a/src/runtime/src/kernel/dma.rs +++ b/src/runtime/src/kernel/dma.rs @@ -116,7 +116,7 @@ pub extern "C" fn dma_record_output(target: i32, word: i32) { } } -pub extern "C" fn dma_record_output_wide(target: i32, words: CSlice) { +pub extern "C" fn dma_record_output_wide(target: i32, words: &CSlice) { assert!(words.len() <= 16); // enforce the hardware limit unsafe { diff --git a/src/runtime/src/rtio_csr.rs b/src/runtime/src/rtio_csr.rs index 2934aca..ca710c0 100644 --- a/src/runtime/src/rtio_csr.rs +++ b/src/runtime/src/rtio_csr.rs @@ -107,7 +107,7 @@ pub extern "C" fn output(target: i32, data: i32) { } } -pub extern "C" fn output_wide(target: i32, data: CSlice) { +pub extern "C" fn output_wide(target: i32, data: &CSlice) { unsafe { csr::rtio::target_write(target as u32); // writing target clears o_data