Skip to content

Commit 43bd938

Browse files
committed
Default watchdog prescaler to 256
1 parent cdc3113 commit 43bd938

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/watchdog.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ impl IndependentWatchDog {
127127
// If the prescaler was changed wait until the change procedure is finished.
128128
while self.iwdg.sr().read().pvu().bit() {}
129129

130-
let psc = self.iwdg.pr().read().pr().variant().unwrap(); // <--- Unwrap!!
130+
let psc = self
131+
.iwdg
132+
.pr()
133+
.read()
134+
.pr()
135+
.variant()
136+
.unwrap_or(PR::DivideBy256);
131137
let reload = self.iwdg.rlr().read().rl().bits();
132138

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

0 commit comments

Comments
 (0)