Prechádzať zdrojové kódy

Merge pull request #236 from TheZoq2/ra-kete-monotimer-fix

Fix `MonoTimer` and `Timer::syst` frequency
Daniel Egger 4 rokov pred
rodič
commit
b1625175f9
3 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 2 0
      CHANGELOG.md
  2. 1 1
      src/time.rs
  3. 1 1
      src/timer.rs

+ 2 - 0
CHANGELOG.md

@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 
 ### Fixed
 
+- Fix wrong frequency reported by `MonoTimer`
+- Fix wrong timings generated by `Timer::syst` 
 - Fix period retrieval for timers
 
 ### Changed

+ 1 - 1
src/time.rs

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

+ 1 - 1
src/timer.rs

@@ -163,7 +163,7 @@ impl Timer<SYST> {
         syst.set_clock_source(SystClkSource::Core);
         Self {
             tim: syst,
-            clk: clocks.sysclk(),
+            clk: clocks.hclk(),
         }
     }