diff --git a/src/libboard_artiq/src/drtio_routing.rs b/src/libboard_artiq/src/drtio_routing.rs index 47d912c2..810fb9e6 100644 --- a/src/libboard_artiq/src/drtio_routing.rs +++ b/src/libboard_artiq/src/drtio_routing.rs @@ -3,6 +3,8 @@ use libconfig::Config; use pl::csr; // <- check if it works in the same way use core::fmt; +use log::{warn, info}; + #[cfg(has_drtio_routing)] pub const DEST_COUNT: usize = 256; #[cfg(not(has_drtio_routing))] @@ -55,12 +57,18 @@ impl fmt::Display for RoutingTable { pub fn config_routing_table(default_n_links: usize, cfg: Config) -> RoutingTable { let mut ret = RoutingTable::default_master(default_n_links); - if let Ok(data) = cfg.read("routing_table").ok() && data.len() == DEST_COUNT*MAX_HOPS { + if let Ok(data) = cfg.read("routing_table") { + if data.len() == DEST_COUNT*MAX_HOPS + { for i in 0..DEST_COUNT { for j in 0..MAX_HOPS { ret.0[i][j] = data[i*MAX_HOPS+j]; } } + } + else { + warn!("could not read routing table from configuration, using default"); + } } else { warn!("could not read routing table from configuration, using default"); diff --git a/src/libboard_artiq/src/lib.rs b/src/libboard_artiq/src/lib.rs index aa09aa39..4e7d9cea 100644 --- a/src/libboard_artiq/src/lib.rs +++ b/src/libboard_artiq/src/lib.rs @@ -1,5 +1,11 @@ #![no_std] +extern crate log; +extern crate libboard_zynq; +extern crate libconfig; +extern crate libcortex_a9; +extern crate log_buffer; + // has csr; taken from runtime main #[path = "../../../build/pl.rs"] pub mod pl; diff --git a/src/libboard_artiq/src/si5324.rs b/src/libboard_artiq/src/si5324.rs index 8327fc0b..1d1e9b5c 100644 --- a/src/libboard_artiq/src/si5324.rs +++ b/src/libboard_artiq/src/si5324.rs @@ -93,6 +93,7 @@ fn write(i2c: &mut I2c, reg: u8, val: u8) -> Result<()> { Ok(()) } +#[allow(dead_code)] fn write_no_ack_value(i2c: &mut I2c, reg: u8, val: u8) -> Result<()> { i2c.start().unwrap(); if !i2c.write(ADDRESS << 1).unwrap() { @@ -134,7 +135,7 @@ fn ident(i2c: &mut I2c) -> Result { Ok(((read(i2c, 134)? as u16) << 8) | (read(i2c, 135)? as u16)) } -fn soft_reset(i2c: &mut I2c) -> Result<()> { +fn soft_reset(_i2c: &mut I2c) -> Result<()> { //TODO write_no_ack_value(i2c, 136, read(136)? | 0x80)?; //TODO clock::spin_us(10_000); Ok(()) diff --git a/src/libio/lib.rs b/src/libio/lib.rs index 0e4f145d..a58d990d 100644 --- a/src/libio/lib.rs +++ b/src/libio/lib.rs @@ -11,9 +11,9 @@ use alloc; #[cfg(feature = "byteorder")] extern crate byteorder; -mod cursor; +pub mod cursor; #[cfg(feature = "byteorder")] -mod proto; +pub mod proto; pub use cursor::Cursor; #[cfg(feature = "byteorder")] diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index 98724ce4..9e6a5585 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -23,8 +23,9 @@ use embedded_hal::blocking::delay::DelayMs; use libconfig::Config; use libregister::RegisterW; use libcortex_a9::l2c::enable_l2_cache; +use libboard_artiq::logger; #[cfg(feature = "target_kasli_soc")] -use libboard_artiq::{si5324, logger}; +use libboard_artiq::si5324; mod proto_async; mod comms; diff --git a/src/satman/main.rs b/src/satman/main.rs index e9e738f6..54f11932 100644 --- a/src/satman/main.rs +++ b/src/satman/main.rs @@ -16,12 +16,12 @@ mod repeater; fn identifier_read(buf: &mut [u8]) -> &str { unsafe { - pl::csr::identifier::address_write(0); - let len = pl::csr::identifier::data_read(); + csr::identifier::address_write(0); + let len = csr::identifier::data_read(); let len = cmp::min(len, buf.len() as u8); for i in 0..len { - pl::csr::identifier::address_write(1 + i); - buf[i as usize] = pl::csr::identifier::data_read(); + csr::identifier::address_write(1 + i); + buf[i as usize] = csr::identifier::data_read(); } str::from_utf8_unchecked(&buf[..len as usize]) }