Skip to content

Commit bc3add6

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rp2040-hal/src/timer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ impl Timer {
6767
clocks: &ReferenceClock,
6868
) -> Self {
6969
assert_eq!(
70-
clocks.freq().to_Hz() / u32::from(watchdog.cycles_per_ticks()),
71-
1_000_000
70+
clocks.freq().to_Hz(),
71+
1_000_000 * u32::from(watchdog.cycles_per_ticks())
7272
);
7373
timer.reset_bring_down(resets);
7474
timer.reset_bring_up(resets);

0 commit comments

Comments
 (0)