Skip to content

Commit

Permalink
Fix period retrival for timers
Browse files Browse the repository at this point in the history
Fix `get_period` for timers
  • Loading branch information
fooker authored Jun 22, 2020
1 parent 28d943d commit c961cff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ macro_rules! hal {
fn get_period(&self) -> Self::Time {
let clk = self.clk;
let psc: u16 = unsafe{(*$TIMX::ptr()).psc.read().psc().bits()};
let arr: u16 = unsafe{(*$TIMX::ptr()).psc.read().psc().bits()};
let arr: u16 = unsafe{(*$TIMX::ptr()).arr.read().arr().bits()};

// Length in ms of an internal clock pulse
(clk.0 / u32(psc * arr)).hz()
Expand Down

0 comments on commit c961cff

Please sign in to comment.