From 546504516b42de8034153734b5544086d529bd81 Mon Sep 17 00:00:00 2001 From: joxe Date: Mon, 21 Jun 2010 09:41:49 +0000 Subject: [PATCH] changed timer comparison to avoid crashing mspgcc4 --- core/sys/timer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/sys/timer.c b/core/sys/timer.c index 756ea4759..d8a602daa 100644 --- a/core/sys/timer.c +++ b/core/sys/timer.c @@ -42,7 +42,7 @@ * * Author: Adam Dunkels * - * $Id: timer.c,v 1.6 2010/02/23 18:40:08 adamdunkels Exp $ + * $Id: timer.c,v 1.7 2010/06/21 09:41:49 joxe Exp $ */ #include "contiki-conf.h" @@ -122,9 +122,10 @@ int timer_expired(struct timer *t) { clock_time_t diff = clock_time() - t->start; - /* This somewhat ugly way of returning (diff >= t->interval) is - required to avoid an internal error in mspgcc. */ - return diff > t->interval || diff == t->interval; + /* Can not return diff >= t->interval so we need to return + t->interval < diff - required to avoid an internal error in mspgcc. */ + return t->interval < diff; + } /*---------------------------------------------------------------------------*/ /**