Update rtic example to reset spinlocks in init

This commit is contained in:
9names 2022-04-11 19:52:14 +10:00
parent 3d8f66df78
commit e9a4f7e40b

View file

@ -27,6 +27,11 @@ mod app {
#[init]
fn init(c: init::Context) -> (Shared, Local, init::Monotonics) {
// Soft-reset does not release the hardware spinlocks
// Release them now to avoid a deadlock after debug or watchdog reset
unsafe {
hal::sio::spinlock_reset();
}
let mut resets = c.device.RESETS;
let mut watchdog = Watchdog::new(c.device.WATCHDOG);
let _clocks = init_clocks_and_plls(