mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 14:44:32 +00:00
msmp0-watchdog: reorder system initialization
This commit is contained in:
parent
b618b6bfcd
commit
0a45a4663c
@ -283,6 +283,20 @@ impl Watchdog {
|
|||||||
// init delay, 16 cycles
|
// init delay, 16 cycles
|
||||||
cortex_m::asm::delay(16);
|
cortex_m::asm::delay(16);
|
||||||
|
|
||||||
|
critical_section::with(|_| {
|
||||||
|
// make sure watchdog triggers BOOTRST
|
||||||
|
pac::SYSCTL.systemcfg().modify(|w| {
|
||||||
|
if *T::regs() == pac::WWDT0 {
|
||||||
|
w.set_wwdtlp0rstdis(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(any(mspm0g110x, mspm0g150x, mspm0g151x, mspm0g310x, mspm0g350x, mspm0g351x))]
|
||||||
|
if *T::regs() == pac::WWDT1 {
|
||||||
|
w.set_wwdtlp1rstdis(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
//init watchdog
|
//init watchdog
|
||||||
T::regs().wwdtctl0().write(|w| {
|
T::regs().wwdtctl0().write(|w| {
|
||||||
w.set_clkdiv(config.timeout.get_clkdiv());
|
w.set_clkdiv(config.timeout.get_clkdiv());
|
||||||
@ -299,20 +313,6 @@ impl Watchdog {
|
|||||||
w.set_key(vals::Wwdtctl1Key::KEY);
|
w.set_key(vals::Wwdtctl1Key::KEY);
|
||||||
});
|
});
|
||||||
|
|
||||||
critical_section::with(|_| {
|
|
||||||
// make sure watchdog triggers BOOTRST
|
|
||||||
pac::SYSCTL.systemcfg().write(|w| {
|
|
||||||
if *T::regs() == pac::WWDT0 {
|
|
||||||
w.set_wwdtlp0rstdis(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(any(mspm0g110x, mspm0g150x, mspm0g151x, mspm0g310x, mspm0g350x, mspm0g351x))]
|
|
||||||
if *T::regs() == pac::WWDT1 {
|
|
||||||
w.set_wwdtlp1rstdis(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
Self { regs: T::regs() }
|
Self { regs: T::regs() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user