mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
Revert "remove api call for reset_reason"
This reverts commit 1dd514f4be.
not sure why but this breaks stability. suspect a loader bug.
This commit is contained in:
parent
1dd514f4be
commit
7ca009d2b0
4 changed files with 25 additions and 0 deletions
|
|
@ -749,6 +749,10 @@ impl ClockManagerImpl {
|
||||||
self.iox.set_gpio_pin_value(self.dcdc2_io.0, self.dcdc2_io.1, bao1x_api::IoxValue::Low);
|
self.iox.set_gpio_pin_value(self.dcdc2_io.0, self.dcdc2_io.1, bao1x_api::IoxValue::Low);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn reset_reason(&self) -> bao1x_api::ResetReason {
|
||||||
|
bao1x_api::ResetReason::new_with_raw_value(self.sysctrl.r(utra::sysctrl::SFR_RCUSRCFR))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
|
|
||||||
|
|
@ -37,4 +37,5 @@ pub enum ClockOp {
|
||||||
GetPclk,
|
GetPclk,
|
||||||
GetPer,
|
GetPer,
|
||||||
DeepSleep,
|
DeepSleep,
|
||||||
|
ResetReason,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -369,4 +369,20 @@ impl ClockManager {
|
||||||
_ => unimplemented!(),
|
_ => 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!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -410,6 +410,10 @@ fn susres_service() {
|
||||||
Some(ClockOp::GetPer) => {
|
Some(ClockOp::GetPer) => {
|
||||||
xous::return_scalar(msg.sender, clk_mgr.perclk as usize).unwrap()
|
xous::return_scalar(msg.sender, clk_mgr.perclk as usize).unwrap()
|
||||||
}
|
}
|
||||||
|
Some(ClockOp::ResetReason) => {
|
||||||
|
xous::return_scalar(msg.sender, clk_mgr.reset_reason().raw_value() as usize)
|
||||||
|
.unwrap()
|
||||||
|
}
|
||||||
_ => panic!("Incorrect PlatformOp"),
|
_ => panic!("Incorrect PlatformOp"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue