From abe8e024ce709afa85dee992f31f82878069d2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20L=C3=B6scher?= Date: Mon, 9 Mar 2015 15:27:47 +0100 Subject: [PATCH] fixed a bug where the scheduled time is not the executed one --- .../apps/mspsim/src/org/contikios/cooja/mspmote/MspMote.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/MspMote.java b/tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/MspMote.java index 85550ef99..b22fbc145 100644 --- a/tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/MspMote.java +++ b/tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/MspMote.java @@ -334,7 +334,7 @@ public abstract class MspMote extends AbstractEmulatedMote implements Mote, Watc /* Execute MSPSim-based mote */ /* TODO Try-catch overhead */ try { - nextExecute = myCpu.stepMicros(t-lastExecute, duration) + t + duration; + nextExecute = myCpu.stepMicros(Math.max(0, t-lastExecute), duration) + t + duration; lastExecute = t; } catch (EmulationException e) { String trace = e.getMessage() + "\n\n" + getStackTrace();