aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtimer
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2015-11-05 17:08:00 +1000
committerinmarket <andrewh@inmarket.com.au>2015-11-05 17:08:00 +1000
commit383be6964ecee62844e842c08e50464fd5b56d5e (patch)
tree6cd98dc64209c7d0d9bf72cca61a4693bcf8a8d8 /src/gtimer
parent32da19db12911d997cc04d35a1ba8b3b52deae01 (diff)
downloaduGFX-383be6964ecee62844e842c08e50464fd5b56d5e.tar.gz
uGFX-383be6964ecee62844e842c08e50464fd5b56d5e.tar.bz2
uGFX-383be6964ecee62844e842c08e50464fd5b56d5e.zip
GTimer fix for fast tick rate systems
Diffstat (limited to 'src/gtimer')
-rw-r--r--src/gtimer/gtimer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gtimer/gtimer.c b/src/gtimer/gtimer.c
index b666eec2..e3262ec1 100644
--- a/src/gtimer/gtimer.c
+++ b/src/gtimer/gtimer.c
@@ -22,6 +22,7 @@ static gfxMutex mutex;
static gfxThreadHandle hThread = 0;
static GTimer *pTimerHead = 0;
static gfxSem waitsem;
+static systemticks_t ticks2ms;
static DECLARE_THREAD_STACK(waTimerThread, GTIMER_THREAD_WORKAREA_SIZE);
/*===========================================================================*/
@@ -99,7 +100,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
// Find when we next need to wake up
if (!(pt->flags & GTIMER_FLG_INFINITE) && pt->when - tm < nxtTimeout)
- nxtTimeout = pt->when - tm;
+ nxtTimeout = (pt->when - tm)/ticks2ms;
pt = pt->next;
} while(pt != pTimerHead);
}
@@ -115,6 +116,7 @@ void _gtimerInit(void)
{
gfxSemInit(&waitsem, 0, 1);
gfxMutexInit(&mutex);
+ ticks2ms = gfxMillisecondsToTicks(1);
}
void _gtimerDeinit(void)