mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
turn off wdt for now
This commit is contained in:
parent
afe8d8733d
commit
0e1464b815
2 changed files with 4 additions and 4 deletions
|
|
@ -24,6 +24,6 @@ utralib = {path = "../../utralib"}
|
||||||
debug-print = []
|
debug-print = []
|
||||||
watchdog = []
|
watchdog = []
|
||||||
# generally you want to disable watchdog if you're doing development
|
# generally you want to disable watchdog if you're doing development
|
||||||
default = ["watchdog"]
|
# default = ["watchdog"]
|
||||||
# default = []
|
default = []
|
||||||
# default = ["debug-print"]
|
# default = ["debug-print"]
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ mod implementation {
|
||||||
wdt_sr_manager: RegManager::<{utra::wdt::WDT_NUMREGS}>,
|
wdt_sr_manager: RegManager::<{utra::wdt::WDT_NUMREGS}>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "watchdog")]
|
||||||
fn handle_wdt(_irq_no: usize, arg: *mut usize) {
|
fn handle_wdt(_irq_no: usize, arg: *mut usize) {
|
||||||
let xtt = unsafe { &mut *(arg as *mut XousTickTimer) };
|
let xtt = unsafe { &mut *(arg as *mut XousTickTimer) };
|
||||||
// disarm the WDT -- do it in an interrupt context, to make sure we aren't interrupted while doing this.
|
// disarm the WDT -- do it in an interrupt context, to make sure we aren't interrupted while doing this.
|
||||||
|
|
@ -77,7 +78,6 @@ mod implementation {
|
||||||
// - the ring oscillator has a tolerance band of 65MHz +/- 50%
|
// - the ring oscillator has a tolerance band of 65MHz +/- 50%
|
||||||
// - the CPU runs at 100MHz with a tight tolerance
|
// - the CPU runs at 100MHz with a tight tolerance
|
||||||
// - thus it is impossible to guarantee sync between the domains, so we do a two-step query/response interlock
|
// - thus it is impossible to guarantee sync between the domains, so we do a two-step query/response interlock
|
||||||
#[cfg(feature = "watchdog")]
|
|
||||||
if xtt.wdt.rf(utra::wdt::STATE_ENABLED) == 1 {
|
if xtt.wdt.rf(utra::wdt::STATE_ENABLED) == 1 {
|
||||||
if xtt.wdt.rf(utra::wdt::STATE_ARMED1) != 0 {
|
if xtt.wdt.rf(utra::wdt::STATE_ARMED1) != 0 {
|
||||||
xtt.wdt.wfo(utra::wdt::WATCHDOG_RESET_CODE, 0x600d);
|
xtt.wdt.wfo(utra::wdt::WATCHDOG_RESET_CODE, 0x600d);
|
||||||
|
|
@ -87,7 +87,6 @@ mod implementation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Clear the interrupt
|
// Clear the interrupt
|
||||||
#[cfg(feature = "watchdog")]
|
|
||||||
xtt.wdt.wfo(utra::wdt::EV_PENDING_SOFT_INT, 1);
|
xtt.wdt.wfo(utra::wdt::EV_PENDING_SOFT_INT, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -161,6 +160,7 @@ mod implementation {
|
||||||
)
|
)
|
||||||
.expect("couldn't claim irq");
|
.expect("couldn't claim irq");
|
||||||
|
|
||||||
|
#[cfg(feature = "watchdog")]
|
||||||
xous::claim_interrupt(
|
xous::claim_interrupt(
|
||||||
utra::wdt::WDT_IRQ,
|
utra::wdt::WDT_IRQ,
|
||||||
handle_wdt,
|
handle_wdt,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue