Ver código fonte

Fix `MonoTimer`s 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.
Jan Teske 4 anos atrás
pai
commit
8a69f770b4
2 arquivos alterados com 3 adições e 1 exclusões
  1. 2 0
      CHANGELOG.md
  2. 1 1
      src/time.rs

+ 2 - 0
CHANGELOG.md

@@ -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
@@ -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

+ 1 - 1
src/time.rs

@@ -241,7 +241,7 @@ impl MonoTimer {
         drop(dwt);
 
         MonoTimer {
-            frequency: clocks.sysclk(),
+            frequency: clocks.hclk(),
         }
     }