Skip to content

Commit

Permalink
Fix MonoTimers frequency
Browse files Browse the repository at this point in the history
This commit sets `MonoTimer`'s frequency to HCLK.

The `MonoTimer` internally counts the cycles of the Cortex core.
The core's clock is HCLK, but SYSCLK was used for the timer's frequency
before this commit.
  • Loading branch information
teskje authored and TheZoq2 committed Jun 24, 2020
1 parent 30aa5ce commit 8a69f77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- Fix wrong frequency reported by `MonoTimer`
- Fix period retrieval for timers

### Changed
Expand All @@ -22,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Improve `SPI` documentation
- Improve `RCC` and `AFIO` register documentation


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

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl MonoTimer {
drop(dwt);

MonoTimer {
frequency: clocks.sysclk(),
frequency: clocks.hclk(),
}
}

Expand Down

0 comments on commit 8a69f77

Please sign in to comment.