rp: Add system reset fn via watchdog

This commit is contained in:
kalkyl 2023-05-17 00:16:36 +02:00
parent 56f2e0c9a0
commit a4772c15c0

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);
})
}
}
} }