From 0acf55a971a377d6f61e07ddeb2f3a7d1cae9f01 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 1 Mar 2021 23:25:54 -0800 Subject: [PATCH] Move static radio_mem to rust --- radio.c | 2 -- src/radio.rs | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/radio.c b/radio.c index 555cf4b..bf0eede 100644 --- a/radio.c +++ b/radio.c @@ -69,8 +69,6 @@ void set_active_device(radio_device_t* d) { active_device = d; } -unsigned char radio_mem [1024*1024*2]; // Radio memory contents, up to 2 Mbytes - // // Read the configuration from text file, and modify the firmware. // diff --git a/src/radio.rs b/src/radio.rs index 45ef5c7..50d59c1 100644 --- a/src/radio.rs +++ b/src/radio.rs @@ -31,6 +31,10 @@ static mut RADIO_TABLE: [(&'static str, &'static radio_device_t); 16] = unsafe { ] }; +// Radio memory contents, up to 2 Mbytes +#[no_mangle] +pub static mut radio_mem: [u8; 1024*1024*2] = [0; 1024*1024*2]; + extern { fn get_active_device() -> *const radio_device_t;