GTimer fix for fast tick rate systems

This commit is contained in:
inmarket 2015-11-05 17:08:00 +10:00
parent 32da19db12
commit 383be6964e
2 changed files with 4 additions and 2 deletions

View File

@ -23,7 +23,7 @@ FEATURE: Replace all references to inline with a reference to GFXINLINE
FEATURE: Added config option GFX_NO_INLINE to run off inlining of ugfx functions.
FEATURE: Added word-wrapping support for gdispDrawStringBox() and gdispFillStringBox()
FIX: Fixing issue in touchscreen calibration code
FIX: Fix gtimer for high clock rate devices
*** Release 2.3 ***
FEATURE: Added more events to the slider widget

View File

@ -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)