diff --git a/services/llio/src/i2c.rs b/services/llio/src/i2c.rs index dc82189bc..cc7f5b332 100644 --- a/services/llio/src/i2c.rs +++ b/services/llio/src/i2c.rs @@ -3,6 +3,8 @@ use heapless::consts::*; use llio::api::*; use llio::send_i2c_response; + +#[cfg(target_os = "none")] use utralib::*; #[derive(Eq, PartialEq)] @@ -11,6 +13,25 @@ enum I2cState { Write, Read, } + +#[cfg(not(target_os = "none"))] +pub struct I2cStateMachine { +} +#[cfg(not(target_os = "none"))] +impl I2cStateMachine { + pub fn new(_ticktimer: xous::CID, _i2c_base: *mut u32) -> Self { + I2cStateMachine {} + } + pub fn initiate(&mut self, _transaction: I2cTransaction ) -> I2cStatus { + I2cStatus::ResponseInProgress + } + pub fn register_listener(&mut self, _listener: xous::CID) -> Result<(), xous::CID> { + Ok(()) + } + pub fn handler(&mut self) { + } +} +#[cfg(target_os = "none")] pub struct I2cStateMachine { transaction: I2cTransaction, state: I2cState, @@ -20,6 +41,7 @@ pub struct I2cStateMachine { i2c_csr: utralib::CSR, listeners: Vec, } +#[cfg(target_os = "none")] impl I2cStateMachine { pub fn new(ticktimer: xous::CID, i2c_base: *mut u32) -> Self { I2cStateMachine { diff --git a/services/llio/src/main.rs b/services/llio/src/main.rs index 2f94f1c12..a86e8ff16 100644 --- a/services/llio/src/main.rs +++ b/services/llio/src/main.rs @@ -360,17 +360,18 @@ mod implementation { // a stub to try to avoid breaking hosted mode for as long as possible. #[cfg(not(target_os = "none"))] mod implementation { - use crate::api::*; + use llio::api::*; use log::{error, info}; pub struct Llio { } impl Llio { - pub fn new() -> Llio { + pub fn new(_handler_conn: xous::CID) -> Llio { Llio { } } + pub fn get_i2c_base(&self) -> *mut u32 { 0 as *mut u32 } pub fn reboot(&self, _reboot_soc: bool) {} pub fn set_reboot_vector(&self, _vector: u32) {}