mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
add reset reason userspace apis
This commit is contained in:
parent
c6b1b6bb79
commit
3b4d6a90ed
2 changed files with 17 additions and 0 deletions
|
|
@ -37,4 +37,5 @@ pub enum ClockOp {
|
|||
GetPclk,
|
||||
GetPer,
|
||||
DeepSleep,
|
||||
ResetReason,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -369,4 +369,20 @@ impl ClockManager {
|
|||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reset_reason(&self) -> bao1x_api::ResetReason {
|
||||
match send_message(
|
||||
self.conn,
|
||||
Message::new_blocking_scalar(
|
||||
SusresOp::PlatformSpecific.to_usize().unwrap(),
|
||||
ClockOp::ResetReason.to_usize().unwrap(),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
) {
|
||||
Ok(xous::Result::Scalar1(reason)) => bao1x_api::ResetReason::new_with_raw_value(reason as u32),
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue