Skip to content

Commit 6a02615

Browse files
Read the whole iwdg sr at once
It's more efficient
1 parent 02c01cd commit 6a02615

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/watchdog.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ impl watchdog::WatchdogEnable for Watchdog {
114114
self.iwdg.rlr.write(|w| w.rl().bits(time.reload));
115115
// Wait until the registers are updated before issuing a reset with
116116
// (potentially false) values
117-
while self.iwdg.sr.read().pvu().bit() {}
118-
while self.iwdg.sr.read().rvu().bit() {}
117+
while self.iwdg.sr.read().bits() != 0 {}
119118
self.iwdg.kr.write(|w| w.key().reset());
120119
}
121120
}

0 commit comments

Comments
 (0)