Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Diff: mstimer/mstimer.c
- 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;
}