mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
add ship mode command
This commit is contained in:
parent
65eab7d60f
commit
ca63091f98
3 changed files with 10 additions and 1 deletions
|
|
@ -62,7 +62,7 @@ pub(crate) enum Opcode {
|
|||
PowerOffSoc,
|
||||
|
||||
/// Ship mode (battery disconnect)
|
||||
//ShipMode,
|
||||
ShipMode,
|
||||
|
||||
/// Is the battery charging?
|
||||
//IsCharging,
|
||||
|
|
|
|||
|
|
@ -59,6 +59,12 @@ impl Com {
|
|||
).map(|_| ())
|
||||
}
|
||||
|
||||
pub fn ship_mode(&self) -> Result<(), xous::Error> {
|
||||
send_message(self.conn,
|
||||
Message::new_scalar(Opcode::ShipMode.to_usize().unwrap(), 0, 0, 0, 0)
|
||||
).map(|_| ())
|
||||
}
|
||||
|
||||
pub fn get_wf200_fw_rev(&self) -> Result<(u8, u8, u8), xous::Error> {
|
||||
let response = send_message(self.conn,
|
||||
Message::new_blocking_scalar(Opcode::Wf200Rev.to_usize().unwrap(), 0, 0, 0, 0))?;
|
||||
|
|
|
|||
|
|
@ -348,6 +348,9 @@ fn xmain() -> ! {
|
|||
}
|
||||
}
|
||||
}
|
||||
Some(Opcode::ShipMode) => {
|
||||
com.txrx(ComState::POWER_SHIPMODE.verb);
|
||||
}
|
||||
Some(Opcode::Wf200Rev) => {
|
||||
com.txrx(ComState::WFX_FW_REV_GET.verb);
|
||||
let major = com.wait_txrx(ComState::LINK_READ.verb, Some(STD_TIMEOUT)) as u8;
|
||||
|
|
|
|||
Loading…
Reference in a new issue