mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
retrofit com to output semver structures
This commit is contained in:
parent
d3337bdaba
commit
65ee48f100
1 changed files with 10 additions and 2 deletions
|
|
@ -110,11 +110,19 @@ impl Com {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_wf200_fw_rev(&self) -> Result<(u8, u8, u8), xous::Error> {
|
||||
pub fn get_wf200_fw_rev(&self) -> Result<SemVer, xous::Error> {
|
||||
let response = send_message(self.conn,
|
||||
Message::new_blocking_scalar(Opcode::Wf200Rev.to_usize().unwrap(), 0, 0, 0, 0))?;
|
||||
if let xous::Result::Scalar1(rev) = response {
|
||||
Ok(((rev >> 16) as u8, (rev >> 8) as u8, rev as u8))
|
||||
Ok(
|
||||
SemVer {
|
||||
maj: ((rev >> 16) & 0xFF) as u16,
|
||||
min: ((rev >> 8) & 0xFF) as u16,
|
||||
rev: (rev & 0xFF) as u16,
|
||||
extra: 0,
|
||||
commit: None
|
||||
}
|
||||
)
|
||||
} else {
|
||||
panic!("unexpected return value: {:#?}", response);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue