convert test routine to use susres api to enter sleep

This commit is contained in:
bunnie 2025-12-16 01:07:16 +08:00
parent 934d6e1082
commit d261090f31
2 changed files with 4 additions and 2 deletions

View file

@ -24,6 +24,7 @@ ux-api = { path = "../../libs/ux-api", optional = true }
pddb = { path = "../pddb", optional = true }
xous-swapper = { path = "../xous-swapper", optional = true }
bytemuck = "1.24.0"
susres = { package = "xous-api-susres", version = "0.9.66" }
# pddb testing
rand = { version = "0.8.5", features = ["getrandom"], optional = true }

View file

@ -128,14 +128,15 @@ impl<'a> ShellCmdApi<'a> for Test {
"keepon" => {
todo!("Fix this to use DCDC2 for keepon (as per baosec v2)");
}
#[cfg(not(feature = "hosted-baosec"))]
"wfi" => {
let gfx = ux_api::service::gfx::Gfx::new(&_env.xns).unwrap();
log::info!("turn off display");
gfx.set_power(false).unwrap();
log::info!("display off");
let hal = bao1x_hal_service::Hal::new();
let susres = susres::Susres::new_without_hook(&_env.xns).unwrap();
log::info!("initiating wfi from test shell...");
hal.wfi();
susres.initiate_suspend().unwrap();
log::info!("waiting after WFI return (system will be in WFI)");
_env.ticktimer.sleep_ms(100).ok();
log::info!("turn on display");