From 1776fb044907d61844f7c52a9bbe6ea3cf20425f Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 9 Jun 2009 19:12:30 +0000 Subject: [PATCH] bugfix: if timer expired but was not yet handled due to long running operations (such as radio transmits), warn and reschedule timer handling later --- .../se/sics/cooja/contikimote/interfaces/ContikiClock.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiClock.java b/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiClock.java index 708cca86e..0705a1820 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiClock.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiClock.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiClock.java,v 1.10 2009/06/08 13:07:54 fros4943 Exp $ + * $Id: ContikiClock.java,v 1.11 2009/06/09 19:12:30 fros4943 Exp $ */ package se.sics.cooja.contikimote.interfaces; @@ -137,8 +137,8 @@ public class ContikiClock extends Clock implements ContikiMoteInterface, PolledB /* Request tick next wakeup time */ int nextExpirationTime = moteMem.getIntValueOf("simNextExpirationTime"); - if (nextExpirationTime == 0) { - logger.warn("Next expiration time is now, delaying one millisecond"); + if (nextExpirationTime <= 0) { + logger.warn("Event timer already expired, but has been delayed: " + nextExpirationTime); mote.scheduleNextWakeup(simulation.getSimulationTime() + Simulation.MILLISECOND); return; }