Skip to content

Commit cabe05c

Browse files
ithinueljannic
andauthored
Timer: Use multiplication in assert instead of division.
Co-authored-by: Jan Niehusmann <[email protected]>
1 parent f933b0c commit cabe05c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rp2040-hal/src/timer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ impl Timer {
6666
watchdog: &Watchdog,
6767
clocks: &ReferenceClock,
6868
) -> Self {
69+
```suggestion
6970
assert_eq!(
70-
clocks.freq().to_Hz() / u32::from(watchdog.cycles_per_ticks()),
71-
1_000_000
71+
clocks.freq().to_Hz(),
72+
1_000_000 * u32::from(watchdog.cycles_per_ticks())
7273
);
7374
timer.reset_bring_down(resets);
7475
timer.reset_bring_up(resets);

0 commit comments

Comments
 (0)