Pārlūkot izejas kodu

Nspire: move timer value reversal from the driver to the HAL

Streetwalrus Einstein 10 gadi atpakaļ
vecāks
revīzija
7945522b31
2 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 2 2
      platform/nspire/Timers.cpp
  2. 2 2
      platform/nspire/Timing.cpp

+ 2 - 2
platform/nspire/Timers.cpp

@@ -57,10 +57,10 @@ void TIMERS::mode(uint32_t timer, bool free_run, bool oneshot, bool interrupt,
 
 void TIMERS::load(uint32_t timer, uint32_t value)
 {
-    timer_load[8 * timer] = 0xFFFFFFFF - value;
+    timer_load[8 * timer] = value;
 }
 
 uint32_t TIMERS::read(uint32_t timer)
 {
-    return 0xFFFFFFFF - timer_value[8 * timer];
+    return timer_value[8 * timer];
 }

+ 2 - 2
platform/nspire/Timing.cpp

@@ -9,7 +9,7 @@ void TIMING::init()
 {
     Timers::init(TIMER);
     Timers::mode(TIMER, true, false, false, 1, true);
-    Timers::load(TIMER, 0);
+    Timers::load(TIMER, 0xFFFFFFFF);
 }
 
 void TIMING::deinit()
@@ -19,5 +19,5 @@ void TIMING::deinit()
 
 unsigned TIMING::gettime()
 {
-    return Timers::read(TIMER);
+    return 0xFFFFFFFF - Timers::read(TIMER);
 }