mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
rp: Add system reset fn via watchdog
This commit is contained in:
parent
56f2e0c9a0
commit
a4772c15c0
@ -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);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user