From b8ff602d9312bb097ed5325aee9e6c969ac2e4cc Mon Sep 17 00:00:00 2001 From: morgan Date: Wed, 1 Nov 2023 13:20:43 +0800 Subject: [PATCH] fix kasli-soc demo compilation warning --- src/libboard_artiq/src/lib.rs | 2 +- src/runtime/src/main.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libboard_artiq/src/lib.rs b/src/libboard_artiq/src/lib.rs index b5ff893..306aad2 100644 --- a/src/libboard_artiq/src/lib.rs +++ b/src/libboard_artiq/src/lib.rs @@ -27,7 +27,7 @@ pub mod drtioaux_async; #[cfg(has_drtio)] #[path = "../../../build/mem.rs"] pub mod mem; -#[cfg(feature = "target_kasli_soc")] +#[cfg(all(feature = "target_kasli_soc", has_drtio))] pub mod io_expander; #[cfg(has_grabber)] pub mod grabber; diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index 519d12b..ebcfc7f 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -11,7 +11,7 @@ extern crate alloc; -#[cfg(feature = "target_kasli_soc")] +#[cfg(all(feature = "target_kasli_soc", has_drtio))] use core::cell::RefCell; use log::{info, warn, error}; @@ -23,7 +23,7 @@ use void::Void; use libconfig::Config; use libcortex_a9::l2c::enable_l2_cache; use libboard_artiq::{logger, identifier_read, init_gateware, pl}; -#[cfg(feature = "target_kasli_soc")] +#[cfg(all(feature = "target_kasli_soc", has_drtio))] use libboard_artiq::io_expander; const ASYNC_ERROR_COLLISION: u8 = 1 << 0; @@ -93,7 +93,7 @@ async fn report_async_rtio_errors() { -#[cfg(feature = "target_kasli_soc")] +#[cfg(all(feature = "target_kasli_soc", has_drtio))] async fn io_expanders_service( i2c_bus: RefCell<&mut libboard_zynq::i2c::I2c>, io_expander0: RefCell, @@ -149,7 +149,7 @@ pub fn main_core0() { info!("gateware ident: {}", identifier_read(&mut [0; 64])); i2c::init(); - #[cfg(feature = "target_kasli_soc")] + #[cfg(all(feature = "target_kasli_soc", has_drtio))] { let i2c_bus = unsafe { (i2c::I2C_BUS).as_mut().unwrap() }; let mut io_expander0 = io_expander::IoExpander::new(i2c_bus, 0).unwrap(); -- 2.47.0