diff options
| author | Siarhei B <[email protected]> | 2025-08-28 10:14:43 +0200 |
|---|---|---|
| committer | Siarhei B <[email protected]> | 2025-08-28 10:18:36 +0200 |
| commit | 0a45a4663c1ced10c96e38efe7ebd1aa9b9e2130 (patch) | |
| tree | 14beba46807b23112dfc502e92909d47cc7e3c7c | |
| parent | b618b6bfcdb42263639e8b348838b764a9ef7a04 (diff) | |
msmp0-watchdog: reorder system initialization
| -rw-r--r-- | embassy-mspm0/src/wwdt.rs | 28 |
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 | ||
