deprecate instances of llio reboot in favor of susres reboot

This commit is contained in:
bunnie 2022-10-17 05:05:37 +08:00
parent 746ab64c2f
commit 9a4b530046
3 changed files with 10 additions and 2 deletions

View file

@ -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)

View file

@ -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

View file

@ -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;