From d261090f31522311ade38e3ec73ca4948392c63b Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 16 Dec 2025 01:07:16 +0800 Subject: [PATCH] convert test routine to use susres api to enter sleep --- services/bao-console/Cargo.toml | 1 + services/bao-console/src/cmds/test.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/bao-console/Cargo.toml b/services/bao-console/Cargo.toml index 75a793921..727697cd1 100644 --- a/services/bao-console/Cargo.toml +++ b/services/bao-console/Cargo.toml @@ -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 } diff --git a/services/bao-console/src/cmds/test.rs b/services/bao-console/src/cmds/test.rs index 5a6dee6f0..6c8c08358 100644 --- a/services/bao-console/src/cmds/test.rs +++ b/services/bao-console/src/cmds/test.rs @@ -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");