Merge #1464
1464: rp: Add system reset fn via watchdog r=Dirbaio a=kalkyl Co-authored-by: kalkyl <henrik.alser@me.com>
This commit is contained in:
commit
908ec5faef
1 changed files with 13 additions and 0 deletions
|
@ -106,4 +106,17 @@ impl Watchdog {
|
|||
self.load_counter(self.load_value);
|
||||
self.enable(true);
|
||||
}
|
||||
|
||||
/// Trigger a system reset
|
||||
pub fn trigger_reset(&mut self) {
|
||||
unsafe {
|
||||
self.configure_wdog_reset_triggers();
|
||||
self.pause_on_debug(false);
|
||||
self.enable(true);
|
||||
let watchdog = pac::WATCHDOG;
|
||||
watchdog.ctrl().write(|w| {
|
||||
w.set_trigger(true);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue