From 19ff09b580e95efe12a3a55eb8906dff678aa8b7 Mon Sep 17 00:00:00 2001 From: scipio Date: Tue, 10 Apr 2007 01:27:10 +0000 Subject: [PATCH] Don't trigger 0 length timers! --- apps/tests/TestSimTimers/TestTimerC.nc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/tests/TestSimTimers/TestTimerC.nc b/apps/tests/TestSimTimers/TestTimerC.nc index aab5ffe6..ee18f71a 100644 --- a/apps/tests/TestSimTimers/TestTimerC.nc +++ b/apps/tests/TestSimTimers/TestTimerC.nc @@ -96,7 +96,7 @@ implementation { aStart = sim_time(); if (aTime & 0xff) { call A.stop(); - aTime = call Random.rand32() & 0x3ff; + aTime = 1 + (call Random.rand32() & 0x3ff); call A.startPeriodic(aTime); } } @@ -104,7 +104,7 @@ implementation { event void B.fired() { check('B', bStart, bTime); call B.stop(); - bTime = call Random.rand32() & 0x3ff; + bTime = 1 + (call Random.rand32() & 0x3ff); call B.startPeriodic(bTime); bStart = sim_time(); } @@ -113,7 +113,7 @@ implementation { check('C', cStart, cTime); if (cTime & 0xff) { call C.stop(); - cTime = call Random.rand32() & 0x3ff; + cTime = 1 + (call Random.rand32() & 0x3ff); } call C.startOneShot(cTime); cStart = sim_time(); @@ -121,7 +121,7 @@ implementation { event void D.fired() { check('D', dStart, dTime); - dTime = call Random.rand32() & 0x3ff; + dTime = 1 + (call Random.rand32() & 0x3ff); call D.startOneShot(dTime); dStart = sim_time(); } -- 2.39.2