From 4b891ebc0413129dbea0b3137467db1263f848f4 Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 24 Dec 2015 09:54:57 +1000 Subject: Fix Gtimer stop bug. --- src/gtimer/gtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gtimer/gtimer.c b/src/gtimer/gtimer.c index dc177f7e..22ec9ed2 100644 --- a/src/gtimer/gtimer.c +++ b/src/gtimer/gtimer.c @@ -76,7 +76,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) { } else { // No - get us off the timers list - if (pt->next == pt->prev) + if (pt->next == pt) pTimerHead = 0; else { pt->next->prev = pt->prev; @@ -148,7 +148,7 @@ void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, bool_t periodic, de // Is this already scheduled? if (pt->flags & GTIMER_FLG_SCHEDULED) { // Cancel it! - if (pt->next == pt->prev) + if (pt->next == pt) pTimerHead = 0; else { pt->next->prev = pt->prev; -- cgit v1.2.3