We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdc3113 commit 43bd938Copy full SHA for 43bd938
src/watchdog.rs
@@ -127,7 +127,13 @@ impl IndependentWatchDog {
127
// If the prescaler was changed wait until the change procedure is finished.
128
while self.iwdg.sr().read().pvu().bit() {}
129
130
- let psc = self.iwdg.pr().read().pr().variant().unwrap(); // <--- Unwrap!!
+ let psc = self
131
+ .iwdg
132
+ .pr()
133
+ .read()
134
135
+ .variant()
136
+ .unwrap_or(PR::DivideBy256);
137
let reload = self.iwdg.rlr().read().rl().bits();
138
139
Milliseconds((into_division_value(psc) * u32::from(reload)) / LSI.integer())
0 commit comments