Skip to content

Commit

Permalink
Timer: Use multiplication in assert instead of division.
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Niehusmann <[email protected]>
  • Loading branch information
ithinuel and jannic authored Aug 18, 2023
1 parent f933b0c commit cabe05c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rp2040-hal/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ impl Timer {
watchdog: &Watchdog,
clocks: &ReferenceClock,
) -> Self {
```suggestion
assert_eq!(
clocks.freq().to_Hz() / u32::from(watchdog.cycles_per_ticks()),
1_000_000
clocks.freq().to_Hz(),
1_000_000 * u32::from(watchdog.cycles_per_ticks())
);
timer.reset_bring_down(resets);
timer.reset_bring_up(resets);
Expand Down

0 comments on commit cabe05c

Please sign in to comment.