From 9a4b530046268ac9b66e941ce075e9d440b95652 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 17 Oct 2022 05:05:37 +0800 Subject: [PATCH] deprecate instances of llio reboot in favor of susres reboot --- services/com/src/lib.rs | 1 + services/com/src/main.rs | 9 ++++++++- services/root-keys/src/main.rs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/services/com/src/lib.rs b/services/com/src/lib.rs index 4a5aacda4..28922b018 100644 --- a/services/com/src/lib.rs +++ b/services/com/src/lib.rs @@ -67,6 +67,7 @@ impl Com { pub fn conn(&self) -> CID {self.conn} pub fn getop_backlight(&self) -> u32 {Opcode::SetBackLight.to_u32().unwrap()} + #[deprecated(note = "Uses susres.immediate_poweroff() instead, as power sequencing requirements have changed.")] pub fn power_off_soc(&self) -> Result<(), xous::Error> { send_message(self.conn, Message::new_scalar(Opcode::PowerOffSoc.to_usize().unwrap(), 0, 0, 0, 0) diff --git a/services/com/src/main.rs b/services/com/src/main.rs index 55b3e6820..6227b8fa9 100644 --- a/services/com/src/main.rs +++ b/services/com/src/main.rs @@ -654,7 +654,14 @@ fn main() -> ! { //info!("0x{:04x}", word); } } - Some(Opcode::PowerOffSoc) => { + Some(Opcode::PowerOffSoc) => { // NOTE: this is deprecated, use susres.immediate_poweroff() instead. Power sequencing requirements have changed since this was created, this routine does not actually cut power anymore. + com.txrx(ComState::CHG_BOOST_OFF.verb); + com.txrx(ComState::LINK_SET_INTMASK.verb); + com.txrx(0); // suppress interrupts on suspend + + if bl_main != 0 || bl_sec != 0 { + com.txrx(ComState::BL_START.verb); // this will turn off the backlights + } info!("power off called"); com.txrx(ComState::POWER_OFF.verb); com.wait_txrx(ComState::LINK_READ.verb, Some(STD_TIMEOUT)); // consume the obligatory return value, even if not used diff --git a/services/root-keys/src/main.rs b/services/root-keys/src/main.rs index 26d89fea9..d1c76dcae 100644 --- a/services/root-keys/src/main.rs +++ b/services/root-keys/src/main.rs @@ -805,7 +805,7 @@ fn main() -> ! { // allow the EC to power me down llio.allow_power_off(true).unwrap(); // now send the power off command - com.power_off_soc().unwrap(); // not that at this point, the screen freezes with the last thing displayed... + susres.immediate_poweroff().unwrap(); log::info!("rebooting now!"); reboot_initiated = true;