Skip to content

Commit 8a69f77

Browse files
teskjeTheZoq2
authored andcommitted
Fix MonoTimers frequency
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.
1 parent 30aa5ce commit 8a69f77

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

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

1414
### Fixed
1515

16+
- Fix wrong frequency reported by `MonoTimer`
1617
- Fix period retrieval for timers
1718

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

26+
2527
## [v0.6.0] - 2020-06-06
2628

2729
### Breaking changes

src/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl MonoTimer {
241241
drop(dwt);
242242

243243
MonoTimer {
244-
frequency: clocks.sysclk(),
244+
frequency: clocks.hclk(),
245245
}
246246
}
247247

0 commit comments

Comments
 (0)