From 3cdf01d5e96b67cc3dca793753eb936ba32d371c Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 19 Aug 2024 02:57:12 +0800 Subject: [PATCH] fix rust-1.80 warnings for cram-soc config --- libs/cramium-hal/Cargo.toml | 2 ++ libs/cramium-hal/src/usb/driver.rs | 2 +- libs/xous-pio/Cargo.toml | 1 + libs/xous-pl230/Cargo.toml | 1 + libs/xous-pl230/src/pl230_tests/units.rs | 10 +++++----- services/cram-console/Cargo.toml | 5 +++++ services/cram-console/src/cmds/mbox.rs | 2 +- services/cram-hal-service/Cargo.toml | 4 ++++ services/usb-device-xous/Cargo.toml | 1 + services/xous-swapper/src/main.rs | 2 +- services/xous-ticktimer/Cargo.toml | 1 + 11 files changed, 23 insertions(+), 8 deletions(-) diff --git a/libs/cramium-hal/Cargo.toml b/libs/cramium-hal/Cargo.toml index ba0687a3f..620e3b9a3 100644 --- a/libs/cramium-hal/Cargo.toml +++ b/libs/cramium-hal/Cargo.toml @@ -25,6 +25,8 @@ bitfield = "0.13.2" xous = { version = "0.9.63", features = ["v2p"] } [features] +compress-entropy = [] +magic-manual = [] std = ["log", "xous-api-names", "usb-device"] derive-rkyv = ["rkyv"] default = [] diff --git a/libs/cramium-hal/src/usb/driver.rs b/libs/cramium-hal/src/usb/driver.rs index 62b0e698f..62de2cbb3 100644 --- a/libs/cramium-hal/src/usb/driver.rs +++ b/libs/cramium-hal/src/usb/driver.rs @@ -981,7 +981,7 @@ impl CorigineUsb { (0x0bc, 0x44087d5a), (0x110, 0x00000000), ]; - #[cfg(feature = "magic_manual")] + #[cfg(feature = "magic-manual")] const MAGIC_TABLE: [(usize, u32); 17] = [ (0x0fc, 0x00000001), (0x084, 0x01401388), diff --git a/libs/xous-pio/Cargo.toml b/libs/xous-pio/Cargo.toml index 2b50649b3..78bd44900 100644 --- a/libs/xous-pio/Cargo.toml +++ b/libs/xous-pio/Cargo.toml @@ -19,6 +19,7 @@ xous = "0.9.63" cramium-soc = ["utralib/cramium-soc"] cramium-fpga = ["utralib/cramium-fpga"] rp2040 = ["defmt"] +arty = [] precursor = [] hosted = [] renode = [] diff --git a/libs/xous-pl230/Cargo.toml b/libs/xous-pl230/Cargo.toml index afe46063d..df0271d1a 100644 --- a/libs/xous-pl230/Cargo.toml +++ b/libs/xous-pl230/Cargo.toml @@ -26,6 +26,7 @@ renode = [] pio = ["xous-pio"] dma-mainram = [] baremetal = [] +debug-print = [] tests = ["pio", "cramium-hal"] default = ["tests", "pio"] diff --git a/libs/xous-pl230/src/pl230_tests/units.rs b/libs/xous-pl230/src/pl230_tests/units.rs index f286555e6..4034b2822 100644 --- a/libs/xous-pl230/src/pl230_tests/units.rs +++ b/libs/xous-pl230/src/pl230_tests/units.rs @@ -33,16 +33,16 @@ pub fn basic_tests(pl230: &mut Pl230) -> bool { const DMA_LEN: usize = 16; // setup the PL230 to do a simple transfer between two memory regions - // dma_mainram feature will cause us to DMA between main memory regions. This works under RTL sims. - #[cfg(feature = "dma_mainram")] + // dma-mainram feature will cause us to DMA between main memory regions. This works under RTL sims. + #[cfg(feature = "dma-mainram")] let mut region_a = [0u32; DMA_LEN]; - #[cfg(feature = "dma_mainram")] + #[cfg(feature = "dma-mainram")] let region_b = [0u32; DMA_LEN]; // The alternate is to DMA between IFRAM regions. This works under FPGA and RTL sim. - #[cfg(not(feature = "dma_mainram"))] + #[cfg(not(feature = "dma-mainram"))] let region_a = unsafe { core::slice::from_raw_parts_mut((utralib::HW_IFRAM0_MEM + 4096) as *mut u32, DMA_LEN) }; - #[cfg(not(feature = "dma_mainram"))] + #[cfg(not(feature = "dma-mainram"))] let region_b = unsafe { core::slice::from_raw_parts_mut(utralib::HW_IFRAM1_MEM as *mut u32, DMA_LEN) }; let mut state = 0x1111_1111; for d in region_a.iter_mut() { diff --git a/services/cram-console/Cargo.toml b/services/cram-console/Cargo.toml index 4e0180413..63bfc1d11 100644 --- a/services/cram-console/Cargo.toml +++ b/services/cram-console/Cargo.toml @@ -33,6 +33,11 @@ xous-swapper = { path = "../xous-swapper" } "cramium-fpga" = ["utralib/cramium-fpga", "xous-pl230/cramium-fpga"] "cramium-soc" = ["utralib/cramium-soc", "xous-pl230/cramium-soc"] "hwsim" = [] +"shellperf" = [] +"mass-storage" = [] +"clifford-poll" = [] +"tts" = [] +"early-ball" = [] "pio-test" = ["xous-pio"] "pl230-test" = ["xous-pl230"] "hwtest" = [] diff --git a/services/cram-console/src/cmds/mbox.rs b/services/cram-console/src/cmds/mbox.rs index 385940ba4..6e689313b 100644 --- a/services/cram-console/src/cmds/mbox.rs +++ b/services/cram-console/src/cmds/mbox.rs @@ -287,7 +287,7 @@ impl<'a> ShellCmdApi<'a> for Mbox { match self.try_send(clifford_pkt) { Ok(_) => { write!(ret, "Packet send Ok\n").ok(); - #[cfg(feature = "cifford-poll")] + #[cfg(feature = "clifford-poll")] { let start = env.ticktimer.elapsed_ms(); while self.poll_not_ready() { diff --git a/services/cram-hal-service/Cargo.toml b/services/cram-hal-service/Cargo.toml index 3efaa012f..711052e4d 100644 --- a/services/cram-hal-service/Cargo.toml +++ b/services/cram-hal-service/Cargo.toml @@ -36,6 +36,10 @@ rkyv = { version = "0.4.3", default-features = false, features = [ [features] app-uart = [] +pio = [] +pio-memlcd = [] +rawserial = [] +pinger = [] swap = [] # add this feature to enable pre-emption quantum-timer = ["utralib"] diff --git a/services/usb-device-xous/Cargo.toml b/services/usb-device-xous/Cargo.toml index 803ef1ee8..eea220543 100644 --- a/services/usb-device-xous/Cargo.toml +++ b/services/usb-device-xous/Cargo.toml @@ -74,6 +74,7 @@ mass-storage = ["usbd_scsi", "usbd_mass_storage"] auto-trng = [] mjolnir = [ ] # the big hammer for debugging Spinal USB issues. A raw memory dump of config and descriptor space. Use with care. +pinger = [] # cramium targets must specify no default features; this is necessary for cargo doc to work. default = ["trng"] diff --git a/services/xous-swapper/src/main.rs b/services/xous-swapper/src/main.rs index 0e6c92f08..342edcb9c 100644 --- a/services/xous-swapper/src/main.rs +++ b/services/xous-swapper/src/main.rs @@ -489,7 +489,7 @@ fn swap_handler( let ss = sss.inner.as_mut().expect("Shared state should be initialized"); let op: Option = FromPrimitive::from_usize(opcode); - #[cfg(feature = "debug-print-verbose")] + #[cfg(feature = "debug-verbose")] writeln!(DebugUart {}, "got Opcode: {:?}", op).ok(); match op { Some(KernelOp::ReadFromSwap) => { diff --git a/services/xous-ticktimer/Cargo.toml b/services/xous-ticktimer/Cargo.toml index 3516ed699..49544e53c 100644 --- a/services/xous-ticktimer/Cargo.toml +++ b/services/xous-ticktimer/Cargo.toml @@ -41,6 +41,7 @@ renode = ["utralib/renode", "susres/renode", "watchdog"] cramium-soc = ["utralib/cramium-soc", "utralib/std"] cramium-fpga = ["utralib/cramium-fpga"] +susres = [] debug-print = [] watchdog = [] timestamp = []