mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
add susres testing feature to the ticktimer-test-client
This commit is contained in:
parent
de9af9cfd1
commit
163f8a23ac
3 changed files with 20 additions and 0 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -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]]
|
||||
|
|
|
|||
|
|
@ -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 = []
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue