Skip to content

Commit b162517

Browse files
authored
Merge pull request #236 from TheZoq2/ra-kete-monotimer-fix
Fix `MonoTimer` and `Timer::syst` frequency
2 parents 30aa5ce + 48eb5fe commit b162517

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313

1414
### Fixed
1515

16+
- Fix wrong frequency reported by `MonoTimer`
17+
- Fix wrong timings generated by `Timer::syst`
1618
- Fix period retrieval for timers
1719

1820
### Changed

src/time.rs

+1-1
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

src/timer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl Timer<SYST> {
163163
syst.set_clock_source(SystClkSource::Core);
164164
Self {
165165
tim: syst,
166-
clk: clocks.sysclk(),
166+
clk: clocks.hclk(),
167167
}
168168
}
169169

0 commit comments

Comments
 (0)