add version with SemVer output for Xous

This commit is contained in:
bunnie 2022-07-13 04:35:53 +08:00
parent bfb93269f3
commit 322941c4ae
2 changed files with 5 additions and 0 deletions

View file

@ -16,6 +16,7 @@ num-derive = {version = "0.3.3", default-features = false}
num-traits = {version = "0.2.14", default-features = false}
susres = {path = "../susres"}
xous-names = {path = "../xous-names"}
xous-semver = "0.1.2"
[target.'cfg(not(any(windows,unix)))'.dependencies]
utralib = {path = "../../utralib"}

View file

@ -4,6 +4,7 @@ pub mod api;
use num_traits::ToPrimitive;
use xous::{send_message, Error, CID};
use xous_semver::SemVer;
#[derive(Debug)]
pub struct Ticktimer {
@ -73,6 +74,9 @@ impl Ticktimer {
.expect("couldn't revert buffer");
String::from(v.version.as_str().unwrap())
}
pub fn get_version_semver(&self) -> SemVer {
SemVer::from_str(self.get_version().lines().next().unwrap()).unwrap()
}
/// Lock the given Mutex. Blocks until the Mutex is locked.
///