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: timer/timer.c
- 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;