diff --git a/Cargo.lock b/Cargo.lock index 5371a7cd3..dabc2e9fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4896,6 +4896,8 @@ dependencies = [ "log", "xous 0.9.56 (registry+https://github.com/rust-lang/crates.io-index)", "xous-api-log", + "xous-api-names", + "xous-api-susres", ] [[package]] diff --git a/services/ticktimer-test-client/Cargo.toml b/services/ticktimer-test-client/Cargo.toml index 2d2a81631..25da74771 100644 --- a/services/ticktimer-test-client/Cargo.toml +++ b/services/ticktimer-test-client/Cargo.toml @@ -10,6 +10,9 @@ version = "0.1.0" xous = "0.9.56" log = "0.4.14" log-server = {package = "xous-api-log", version = "0.1.52"} +susres = {package = "xous-api-susres", version = "0.9.52", optional = true} +xous-names = {package = "xous-api-names", version = "0.9.54", optional = true} [features] +susres-testing = ["susres", "xous-names"] default = [] diff --git a/services/ticktimer-test-client/src/main.rs b/services/ticktimer-test-client/src/main.rs index 0315f0d62..e8d0b9140 100644 --- a/services/ticktimer-test-client/src/main.rs +++ b/services/ticktimer-test-client/src/main.rs @@ -10,11 +10,26 @@ fn main() -> ! { log::set_max_level(log::LevelFilter::Trace); info!("my PID is {}", xous::process::id()); + #[cfg(feature="susres-testing")] + const DELAY_MS: u64 = 2000; + #[cfg(not(feature="susres-testing"))] const DELAY_MS: u64 = 5000; + #[cfg(feature="susres-testing")] + let xns = xous_names::XousNames::new().unwrap(); + #[cfg(feature="susres-testing")] + let susres = susres::Susres::new_without_hook(&xns).unwrap(); + for i in 0.. { info!("Loop #{}, waiting {} ms", i, DELAY_MS); sleep(Duration::from_millis(DELAY_MS)); + #[cfg(feature="susres-testing")] + { + info!("initiate suspend"); + susres.initiate_suspend().unwrap(); + info!("after suspend, sleeping"); + sleep(Duration::from_millis(DELAY_MS)); + } } panic!("Finished endless loop");