Andrew Boyson / clock

Dependents:   oldheating gps motorhome heating

Files at this revision

API Documentation at this revision

Comitter:
andrewboyson
Date:
Mon Oct 07 07:19:18 2019 +0000
Parent:
67:c44c5c90e35a
Child:
69:4e48d3859b87
Commit message:
Include arm_compat.h to allow the use of the __[en/dis]able_irq intrinsics.

Changed in this revision

clk/clktime.c Show annotated file Show diff for this revision Revisions of this file
--- a/clk/clktime.c	Fri Sep 27 11:29:57 2019 +0000
+++ b/clk/clktime.c	Mon Oct 07 07:19:18 2019 +0000
@@ -1,5 +1,6 @@
 #include <stdint.h>
 #include <stdbool.h>
+#include <arm_compat.h> //Used for the __[en/dis]able_irq intrinsics
 
 #include "rtc.h"
 #include "tm.h"
@@ -29,25 +30,21 @@
      clktime fraction = (timerCountSinceLastSecond << CLK_TIME_ONE_SECOND_SHIFT) / HR_TIMER_COUNT_PER_SECOND;
      clktime    ticks = extClock - fraction;
 
-    //__disable_irq();
-    __asm("CPSID I");
+    __disable_irq();
         tickCount = ticks;
         slewCount = 0;
-    //__enable_irq();
-    __asm("CPSIE I");
+    __enable_irq();
     
     countIsSet = true;
 }
 void ClkTimeIncrementByOneSecond(uint32_t startCount)
 {
-    //__disable_irq();
-    __asm("CPSID I");
+    __disable_irq();
         hrTimerAtLastIncrement = startCount;
         tickCount += CLK_TIME_ONE_SECOND + ClkGovGetPpb();
         slewCount += ClkGovGetSlew();
         ClkGovSetSlew(0);
-    //__enable_irq();
-    __asm("CPSIE I");
+    __enable_irq();
 }
 
 static volatile  clktime  tickSnapshot;