Skip to content

Commit e1b045b

Browse files
committed
fix delay
1 parent 695cbb8 commit e1b045b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/timer/delay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub type DelayMs<TIM> = Delay<TIM, 1_000>;
8585
impl<TIM: Instance, const FREQ: u32> Delay<TIM, FREQ> {
8686
/// Sleep for given time
8787
pub fn delay(&mut self, time: TimerDurationU32<FREQ>) {
88-
let mut ticks = time.ticks().min(1) - 1;
88+
let mut ticks = time.ticks().max(1) - 1;
8989
while ticks != 0 {
9090
let reload = ticks.min(TIM::max_auto_reload());
9191

0 commit comments

Comments
 (0)