mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +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,
|
PowerOffSoc,
|
||||||
|
|
||||||
/// Ship mode (battery disconnect)
|
/// Ship mode (battery disconnect)
|
||||||
//ShipMode,
|
ShipMode,
|
||||||
|
|
||||||
/// Is the battery charging?
|
/// Is the battery charging?
|
||||||
//IsCharging,
|
//IsCharging,
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,12 @@ impl Com {
|
||||||
).map(|_| ())
|
).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> {
|
pub fn get_wf200_fw_rev(&self) -> Result<(u8, u8, u8), xous::Error> {
|
||||||
let response = send_message(self.conn,
|
let response = send_message(self.conn,
|
||||||
Message::new_blocking_scalar(Opcode::Wf200Rev.to_usize().unwrap(), 0, 0, 0, 0))?;
|
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) => {
|
Some(Opcode::Wf200Rev) => {
|
||||||
com.txrx(ComState::WFX_FW_REV_GET.verb);
|
com.txrx(ComState::WFX_FW_REV_GET.verb);
|
||||||
let major = com.wait_txrx(ComState::LINK_READ.verb, Some(STD_TIMEOUT)) as u8;
|
let major = com.wait_txrx(ComState::LINK_READ.verb, Some(STD_TIMEOUT)) as u8;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue