aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtimer
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-07-08 15:15:15 +1000
committerinmarket <andrewh@inmarket.com.au>2018-07-08 15:15:15 +1000
commit93da5a0578e7f16ea846eb257f36a24e316ef8d4 (patch)
treeb0e08e991919fdb1fa9079b0ea40c23909cbcd3e /src/gtimer
parent215f31ee3dd27f461540384cdba04b58b481fadc (diff)
downloaduGFX-93da5a0578e7f16ea846eb257f36a24e316ef8d4.tar.gz
uGFX-93da5a0578e7f16ea846eb257f36a24e316ef8d4.tar.bz2
uGFX-93da5a0578e7f16ea846eb257f36a24e316ef8d4.zip
gDelayNone/gDelayForever to replace TIME_IMMEDIATE/TIME_INFINITE
Diffstat (limited to 'src/gtimer')
-rw-r--r--src/gtimer/gtimer.c10
-rw-r--r--src/gtimer/gtimer.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gtimer/gtimer.c b/src/gtimer/gtimer.c
index 93e93b6f..6dc0d6f8 100644
--- a/src/gtimer/gtimer.c
+++ b/src/gtimer/gtimer.c
@@ -38,7 +38,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
void *param;
(void) arg;
- nxtTimeout = TIME_INFINITE;
+ nxtTimeout = gDelayForever;
lastTime = 0;
while(1) {
/* Wait for work to do. */
@@ -49,7 +49,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
// Our reference time
tm = gfxSystemTicks();
- nxtTimeout = TIME_INFINITE;
+ nxtTimeout = gDelayForever;
/* We need to obtain the mutex */
gfxMutexEnter(&mutex);
@@ -61,7 +61,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
if ((pt->flags & GTIMER_FLG_JABBED) || (!(pt->flags & GTIMER_FLG_INFINITE) && TimeIsWithin(pt->when, lastTime, tm))) {
// Is this timer periodic?
- if ((pt->flags & GTIMER_FLG_PERIODIC) && pt->period != TIME_IMMEDIATE) {
+ if ((pt->flags & GTIMER_FLG_PERIODIC) && pt->period != gDelayNone) {
// Yes - Update ready for the next period
if (!(pt->flags & GTIMER_FLG_INFINITE)) {
// We may have skipped a period.
@@ -164,9 +164,9 @@ void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, gBool periodic, gDe
pt->flags = GTIMER_FLG_SCHEDULED;
if (periodic)
pt->flags |= GTIMER_FLG_PERIODIC;
- if (millisec == TIME_INFINITE) {
+ if (millisec == gDelayForever) {
pt->flags |= GTIMER_FLG_INFINITE;
- pt->period = TIME_INFINITE;
+ pt->period = gDelayForever;
} else {
pt->period = gfxMillisecondsToTicks(millisec);
pt->when = gfxSystemTicks() + pt->period;
diff --git a/src/gtimer/gtimer.h b/src/gtimer/gtimer.h
index 67c7539f..aeae880f 100644
--- a/src/gtimer/gtimer.h
+++ b/src/gtimer/gtimer.h
@@ -89,9 +89,9 @@ void gtimerDeinit(GTimer* pt);
* @param[in] param The parameter to pass to the callback function
* @param[in] periodic Is the timer a periodic timer? gFalse is a once-only timer.
* @param[in] millisec The timer period. The following special values are allowed:
- * TIME_IMMEDIATE causes the callback function to be called asap.
+ * gDelayNone causes the callback function to be called asap.
* A periodic timer with this value will fire once only.
- * TIME_INFINITE never timeout (unless triggered by gtimerJab or gtimerJabI)
+ * gDelayForever never timeout (unless triggered by gtimerJab or gtimerJabI)
*
* @note If the timer is already active its properties are updated with the new parameters.
* The current period will be immediately canceled (without the callback function being