Andrew Boyson / clock

Dependents:   oldheating gps motorhome heating

Revision:
38:25b2a3c494aa
Parent:
35:ba9f575aa3c6
Child:
39:5b594b1b6a0a
--- a/timer/timer.c	Sat Dec 01 19:13:29 2018 +0000
+++ b/timer/timer.c	Sun Dec 02 18:38:22 2018 +0000
@@ -1,8 +1,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 
-#include "timer.h"
-#include "tick.h"
+#include   "timer.h"
 
 #define TCR  (*((volatile unsigned *) 0x40004004))
 #define TC   (*((volatile unsigned *) 0x40004008))
@@ -33,7 +32,7 @@
 
 bool TimerIntervalHasElapsed(uint32_t* pBaseCount, uint32_t intervalCount)
 {
-    if (TC - *pBaseCount > intervalCount) //All unsigned wrap around arithmetic
+    if (TC - *pBaseCount >= intervalCount) //All unsigned wrap around arithmetic
     {
         *pBaseCount += intervalCount;
         return true;