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
1 changed files with 1 additions and 1 deletions

View File

@ -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();