fixed a bug where the scheduled time is not the executed one
This commit is contained in:
parent
44c317ce1c
commit
abe8e024ce
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user