Andrew Boyson / clock

Dependents:   oldheating gps motorhome heating

Revision:
61:05bc814bf20b
Parent:
40:53666b1a5848
Child:
62:d382c178399e
diff -r 7e3185a6ffa6 -r 05bc814bf20b mstimer/mstimer.c
--- a/mstimer/mstimer.c	Fri Feb 22 11:25:37 2019 +0000
+++ b/mstimer/mstimer.c	Wed Mar 20 10:54:11 2019 +0000
@@ -6,7 +6,12 @@
 
 uint32_t MsTimerCount = 0;
 
-bool MsTimerHasElapsed(uint32_t baseMsCount, uint32_t intervalMs)
+bool MsTimerUntil(uint32_t untilMs)                            //This uses signed comparison so it is limited to 24 days
+{
+    return (int)(MsTimerCount - untilMs) > 0;
+}
+
+bool MsTimerInterval(uint32_t baseMsCount, uint32_t intervalMs) //This uses unsigned comparison so it is limited to 49 days
 {
     return MsTimerCount - baseMsCount >= intervalMs;
 }