From 1848789ca3118279d636de10006f5cafc8338444 Mon Sep 17 00:00:00 2001 From: Asaf Fisher Date: Wed, 3 Feb 2021 21:43:14 +0200 Subject: [PATCH 1/2] rom: Make rom_funcs functions call function instead of returning it --- rp2040-hal/src/rom_data.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rp2040-hal/src/rom_data.rs b/rp2040-hal/src/rom_data.rs index e7a370b..4bfea7a 100644 --- a/rp2040-hal/src/rom_data.rs +++ b/rp2040-hal/src/rom_data.rs @@ -35,8 +35,9 @@ macro_rules! rom_funcs { ) => { $( $(#[$outer])* - pub fn $name() -> extern "C" fn( $( $aname : $aty ),* ) -> $ret { - rom_table_lookup(FUNC_TABLE, *$c) + pub fn $name($( $aname:$aty ),*) -> $ret{ + let func: extern "C" fn( $( $aty ),* ) -> $ret = rom_table_lookup(FUNC_TABLE, *$c); + func($( $aname ),*) } )* } From 913c5fb0b239e7097057d28df9b892cf4aa004a9 Mon Sep 17 00:00:00 2001 From: Asaf Fisher Date: Wed, 3 Feb 2021 21:49:48 +0200 Subject: [PATCH 2/2] rom: Fix type error --- rp2040-hal/src/rom_data.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rp2040-hal/src/rom_data.rs b/rp2040-hal/src/rom_data.rs index 4bfea7a..9f46297 100644 --- a/rp2040-hal/src/rom_data.rs +++ b/rp2040-hal/src/rom_data.rs @@ -91,7 +91,7 @@ rom_funcs! { /// Program data to a range of flash addresses starting at addr (offset from the start of flash) /// and count bytesin size. addr must be aligned to a 256-byte boundary, and count must be a /// multiple of 256. - b"RP" flash_range_program(addr: u32, data: *mut u8, count: usize) -> (); + b"RP" flash_range_program(addr: u32, data: *const u8, count: usize) -> (); /// Flush and enable the XIP cache. Also clears the IO forcing on QSPI CSn, so that the SSI can /// drive the flashchip select as normal.