From d72a2e7d07e2b102726430fe3f13440e4fbec508 Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Fri, 17 Feb 2023 17:49:36 +0800 Subject: [PATCH] fix previous commit Co-authored-by: Egor Savkin Co-committed-by: Egor Savkin --- src/runtime/src/main.rs | 6 ++++-- src/satman/src/main.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index 9364322c..faef0a60 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -21,7 +21,9 @@ use nb; use void::Void; use libconfig::Config; use libcortex_a9::l2c::enable_l2_cache; -use libboard_artiq::{logger, identifier_read, pl, io_expander}; +use libboard_artiq::{logger, identifier_read, pl}; +#[cfg(feature = "target_kasli_soc")] +use libboard_artiq::io_expander; const ASYNC_ERROR_COLLISION: u8 = 1 << 0; const ASYNC_ERROR_BUSY: u8 = 1 << 1; @@ -116,7 +118,7 @@ pub fn main_core0() { #[cfg(feature = "target_kasli_soc")] { let i2c = unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() }; - for expander_i in 0..2 { + for expander_i in 0..=1 { let mut io_expander = io_expander::IoExpander::new(i2c, expander_i).unwrap(); io_expander.init().expect("I2C I/O expander #0 initialization failed"); // Actively drive TX_DISABLE to false on SFP0..3 diff --git a/src/satman/src/main.rs b/src/satman/src/main.rs index 777654ed..1c00651e 100644 --- a/src/satman/src/main.rs +++ b/src/satman/src/main.rs @@ -22,7 +22,9 @@ use libboard_zynq::{i2c::I2c, timer::GlobalTimer, time::Milliseconds, print, pri use libsupport_zynq::ram; #[cfg(has_si5324)] use libboard_artiq::si5324; -use libboard_artiq::{pl::csr, drtio_routing, drtioaux, logger, identifier_read, io_expander}; +#[cfg(feature = "target_kasli_soc")] +use libboard_artiq::io_expander; +use libboard_artiq::{pl::csr, drtio_routing, drtioaux, logger, identifier_read}; use libcortex_a9::{spin_lock_yield, interrupt_handler, regs::{MPIDR, SP}, notify_spin_lock, asm, l2c::enable_l2_cache}; use libregister::{RegisterW, RegisterR}; #[cfg(feature = "target_kasli_soc")] @@ -451,7 +453,7 @@ pub extern fn main_core0() -> i32 { i2c.init().expect("I2C initialization failed"); #[cfg(feature = "target_kasli_soc")] { - for expander_i in 0..2 { + for expander_i in 0..=1 { let mut io_expander = io_expander::IoExpander::new(&mut i2c, expander_i).unwrap(); io_expander.init().expect("I2C I/O expander #0 initialization failed"); // Actively drive TX_DISABLE to false on SFP0..3