Andrew Boyson / clock

Dependents:   oldheating gps motorhome heating

Revision:
34:aeb58975e61a
Parent:
33:b9e3c06e7dab
--- a/timer.c	Fri Nov 30 18:28:04 2018 +0000
+++ b/timer.c	Fri Nov 30 19:23:48 2018 +0000
@@ -33,7 +33,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;