Skip to content

Commit

Permalink
Added clarifying comment
Browse files Browse the repository at this point in the history
  • Loading branch information
diondokter committed Oct 2, 2023
1 parent 137e47f commit a9dc887
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions embassy-stm32/src/timer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ pub(crate) mod sealed {
Self::regs().cr1().modify(|r| r.set_cen(false));
}

/// Reset the counter value to 0
fn reset(&mut self) {
Self::regs().cnt().write(|r| r.set_cnt(0));
}

/// Set the frequency of how many times per second the timer counts up to the max value or down to 0.
///
/// This means that in the default edge-aligned mode,
/// the timer counter will wrap around at the same frequency as is being set.
/// In center-aligned mode (which not all timers support), the wrap-around frequency is effectively halved
/// because it needs to count up and down.
fn set_frequency(&mut self, frequency: Hertz) {
let f = frequency.0;
let timer_f = Self::frequency().0;
Expand Down Expand Up @@ -515,9 +522,5 @@ foreach_interrupt! {
crate::pac::$inst
}
}




};
}

0 comments on commit a9dc887

Please sign in to comment.