1
0
Fork 0

fix kasli-soc demo compilation warning

This commit is contained in:
morgan 2023-10-25 11:45:13 +08:00
parent a08a42c954
commit 43e4527392
2 changed files with 8 additions and 8 deletions

View File

@ -19,7 +19,7 @@ pub mod drtioaux;
#[cfg(has_drtio)] #[cfg(has_drtio)]
pub mod drtioaux_async; pub mod drtioaux_async;
pub mod drtioaux_proto; pub mod drtioaux_proto;
#[cfg(feature = "target_kasli_soc")] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
pub mod io_expander; pub mod io_expander;
pub mod logger; pub mod logger;
#[cfg(has_drtio)] #[cfg(has_drtio)]

View File

@ -8,14 +8,14 @@
#[macro_use] #[macro_use]
extern crate alloc; extern crate alloc;
#[cfg(feature = "target_kasli_soc")] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
use core::cell::RefCell; use core::cell::RefCell;
use ksupport; use ksupport;
use libasync::task; use libasync::task;
#[cfg(has_drtio_eem)] #[cfg(has_drtio_eem)]
use libboard_artiq::drtio_eem; use libboard_artiq::drtio_eem;
#[cfg(feature = "target_kasli_soc")] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
use libboard_artiq::io_expander; use libboard_artiq::io_expander;
use libboard_artiq::{identifier_read, logger, pl}; use libboard_artiq::{identifier_read, logger, pl};
use libboard_zynq::{gic, mpcore, timer::GlobalTimer}; use libboard_zynq::{gic, mpcore, timer::GlobalTimer};
@ -38,7 +38,7 @@ mod rtio_mgt;
#[cfg(has_drtio)] #[cfg(has_drtio)]
mod subkernel; mod subkernel;
#[cfg(feature = "target_kasli_soc")] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
async fn io_expanders_service( async fn io_expanders_service(
i2c_bus: RefCell<&mut libboard_zynq::i2c::I2c>, i2c_bus: RefCell<&mut libboard_zynq::i2c::I2c>,
io_expander0: RefCell<io_expander::IoExpander>, io_expander0: RefCell<io_expander::IoExpander>,
@ -93,12 +93,12 @@ pub fn main_core0() {
info!("gateware ident: {}", identifier_read(&mut [0; 64])); info!("gateware ident: {}", identifier_read(&mut [0; 64]));
ksupport::i2c::init(); ksupport::i2c::init();
#[cfg(feature = "target_kasli_soc")] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
let i2c_bus = unsafe { (ksupport::i2c::I2C_BUS).as_mut().unwrap() }; let i2c_bus = unsafe { (ksupport::i2c::I2C_BUS).as_mut().unwrap() };
#[cfg(feature = "target_kasli_soc")] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
let (mut io_expander0, mut io_expander1); let (mut io_expander0, mut io_expander1);
#[cfg(feature = "target_kasli_soc")] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
{ {
io_expander0 = io_expander::IoExpander::new(i2c_bus, 0).unwrap(); io_expander0 = io_expander::IoExpander::new(i2c_bus, 0).unwrap();
io_expander1 = io_expander::IoExpander::new(i2c_bus, 1).unwrap(); io_expander1 = io_expander::IoExpander::new(i2c_bus, 1).unwrap();
@ -135,7 +135,7 @@ pub fn main_core0() {
task::spawn(ksupport::report_async_rtio_errors()); task::spawn(ksupport::report_async_rtio_errors());
#[cfg(feature = "target_kasli_soc")] #[cfg(all(feature = "target_kasli_soc", has_drtio))]
task::spawn(io_expanders_service( task::spawn(io_expanders_service(
RefCell::new(i2c_bus), RefCell::new(i2c_bus),
RefCell::new(io_expander0), RefCell::new(io_expander0),