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:
bors[bot] 2023-05-16 22:20:40 +00:00 committed by GitHub
commit 908ec5faef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,4 +106,17 @@ impl Watchdog {
self.load_counter(self.load_value); self.load_counter(self.load_value);
self.enable(true); 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);
})
}
}
} }