fixed a bug where the scheduled time is not the executed one

This commit is contained in:
Andreas Löscher 2015-03-09 15:27:47 +01:00
parent 44c317ce1c
commit abe8e024ce

View file

@ -334,7 +334,7 @@ public abstract class MspMote extends AbstractEmulatedMote implements Mote, Watc
/* Execute MSPSim-based mote */ /* Execute MSPSim-based mote */
/* TODO Try-catch overhead */ /* TODO Try-catch overhead */
try { try {
nextExecute = myCpu.stepMicros(t-lastExecute, duration) + t + duration; nextExecute = myCpu.stepMicros(Math.max(0, t-lastExecute), duration) + t + duration;
lastExecute = t; lastExecute = t;
} catch (EmulationException e) { } catch (EmulationException e) {
String trace = e.getMessage() + "\n\n" + getStackTrace(); String trace = e.getMessage() + "\n\n" + getStackTrace();