mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
add susres testing feature to the ticktimer-test-client
This commit is contained in:
parent
10154b8372
commit
385e15084a
3 changed files with 20 additions and 0 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -4908,6 +4908,8 @@ dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"xous 0.9.56 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xous 0.9.56 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"xous-api-log",
|
"xous-api-log",
|
||||||
|
"xous-api-names",
|
||||||
|
"xous-api-susres",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ version = "0.1.0"
|
||||||
xous = "0.9.56"
|
xous = "0.9.56"
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
log-server = {package = "xous-api-log", version = "0.1.52"}
|
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]
|
[features]
|
||||||
|
susres-testing = ["susres", "xous-names"]
|
||||||
default = []
|
default = []
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,26 @@ fn main() -> ! {
|
||||||
log::set_max_level(log::LevelFilter::Trace);
|
log::set_max_level(log::LevelFilter::Trace);
|
||||||
info!("my PID is {}", xous::process::id());
|
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;
|
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.. {
|
for i in 0.. {
|
||||||
info!("Loop #{}, waiting {} ms", i, DELAY_MS);
|
info!("Loop #{}, waiting {} ms", i, DELAY_MS);
|
||||||
sleep(Duration::from_millis(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");
|
panic!("Finished endless loop");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue