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 and TheZoq2 committed Jun 23, 2020
1 parent 28d943d commit e89fcd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Fixed

- Fix period retrival for timers

## [v0.6.0] - 2020-06-06

### Breaking changes
Expand Down
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 e89fcd3

Please sign in to comment.