aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-mspm0/src/wwdt.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/embassy-mspm0/src/wwdt.rs b/embassy-mspm0/src/wwdt.rs
index 38d76ed56..e5c62c660 100644
--- a/embassy-mspm0/src/wwdt.rs
+++ b/embassy-mspm0/src/wwdt.rs
@@ -283,6 +283,20 @@ impl Watchdog {
283 // init delay, 16 cycles 283 // init delay, 16 cycles
284 cortex_m::asm::delay(16); 284 cortex_m::asm::delay(16);
285 285
286 critical_section::with(|_| {
287 // make sure watchdog triggers BOOTRST
288 pac::SYSCTL.systemcfg().modify(|w| {
289 if *T::regs() == pac::WWDT0 {
290 w.set_wwdtlp0rstdis(false);
291 }
292
293 #[cfg(any(mspm0g110x, mspm0g150x, mspm0g151x, mspm0g310x, mspm0g350x, mspm0g351x))]
294 if *T::regs() == pac::WWDT1 {
295 w.set_wwdtlp1rstdis(false);
296 }
297 });
298 });
299
286 //init watchdog 300 //init watchdog
287 T::regs().wwdtctl0().write(|w| { 301 T::regs().wwdtctl0().write(|w| {
288 w.set_clkdiv(config.timeout.get_clkdiv()); 302 w.set_clkdiv(config.timeout.get_clkdiv());
@@ -299,20 +313,6 @@ impl Watchdog {
299 w.set_key(vals::Wwdtctl1Key::KEY); 313 w.set_key(vals::Wwdtctl1Key::KEY);
300 }); 314 });
301 315
302 critical_section::with(|_| {
303 // make sure watchdog triggers BOOTRST
304 pac::SYSCTL.systemcfg().write(|w| {
305 if *T::regs() == pac::WWDT0 {
306 w.set_wwdtlp0rstdis(false);
307 }
308
309 #[cfg(any(mspm0g110x, mspm0g150x, mspm0g151x, mspm0g310x, mspm0g350x, mspm0g351x))]
310 if *T::regs() == pac::WWDT1 {
311 w.set_wwdtlp1rstdis(false);
312 }
313 });
314 });
315
316 Self { regs: T::regs() } 316 Self { regs: T::regs() }
317 } 317 }
318 318