Skip to content

Commit

Permalink
Default watchdog prescaler to 256
Browse files Browse the repository at this point in the history
  • Loading branch information
usbalbin committed Dec 15, 2024
1 parent cdc3113 commit 43bd938
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ impl IndependentWatchDog {
// If the prescaler was changed wait until the change procedure is finished.
while self.iwdg.sr().read().pvu().bit() {}

let psc = self.iwdg.pr().read().pr().variant().unwrap(); // <--- Unwrap!!
let psc = self
.iwdg
.pr()
.read()
.pr()
.variant()
.unwrap_or(PR::DivideBy256);
let reload = self.iwdg.rlr().read().rl().bits();

Milliseconds((into_division_value(psc) * u32::from(reload)) / LSI.integer())
Expand Down

0 comments on commit 43bd938

Please sign in to comment.