Skip to content

Commit e89fcd3

Browse files
fookerTheZoq2
authored andcommitted
Fix period retrival for timers
Fix `get_period` for timers
1 parent 28d943d commit e89fcd3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fix period retrival for timers
13+
1014
## [v0.6.0] - 2020-06-06
1115

1216
### Breaking changes

src/pwm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ macro_rules! hal {
371371
fn get_period(&self) -> Self::Time {
372372
let clk = self.clk;
373373
let psc: u16 = unsafe{(*$TIMX::ptr()).psc.read().psc().bits()};
374-
let arr: u16 = unsafe{(*$TIMX::ptr()).psc.read().psc().bits()};
374+
let arr: u16 = unsafe{(*$TIMX::ptr()).arr.read().arr().bits()};
375375

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

0 commit comments

Comments
 (0)