From 26ab2927b9cec5abb9fcccd85f086971bd73dbe1 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 11 Feb 2022 12:00:39 +0800 Subject: [PATCH] pca954x: log detected type --- libboard_zynq/src/i2c/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libboard_zynq/src/i2c/mod.rs b/libboard_zynq/src/i2c/mod.rs index 25e65fa..0e48798 100644 --- a/libboard_zynq/src/i2c/mod.rs +++ b/libboard_zynq/src/i2c/mod.rs @@ -6,6 +6,8 @@ use super::slcr; use super::time::Microseconds; use embedded_hal::timer::CountDown; use libregister::{RegisterR, RegisterRW, RegisterW}; +#[cfg(feature = "target_kasli_soc")] +use log::info; pub enum I2cMultiplexer { PCA9548 = 0, @@ -163,8 +165,8 @@ impl I2c { let config = self.read(false)?; let pca = match config { - 0x00 => I2cMultiplexer::PCA9548, - 0x08 => I2cMultiplexer::PCA9547, + 0x00 => { info!("PCA9548 detected"); I2cMultiplexer::PCA9548 }, + 0x08 => { info!("PCA9547 detected"); I2cMultiplexer::PCA9547 }, _ => { return Err("Unknown response for PCA954X autodetect")}, }; self.stop()?;