Browse Source

Read the whole iwdg sr at once

It's more efficient
features/pwm
David Sawatzke 4 years ago
parent
commit
6a02615074
  1. 3
      src/watchdog.rs

3
src/watchdog.rs

@ -114,8 +114,7 @@ impl watchdog::WatchdogEnable for Watchdog {
self.iwdg.rlr.write(|w| w.rl().bits(time.reload));
// Wait until the registers are updated before issuing a reset with
// (potentially false) values
while self.iwdg.sr.read().pvu().bit() {}
while self.iwdg.sr.read().rvu().bit() {}
while self.iwdg.sr.read().bits() != 0 {}
self.iwdg.kr.write(|w| w.key().reset());
}
}

Loading…
Cancel
Save