]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Don't trigger 0 length timers!
authorscipio <scipio>
Tue, 10 Apr 2007 01:27:10 +0000 (01:27 +0000)
committerscipio <scipio>
Tue, 10 Apr 2007 01:27:10 +0000 (01:27 +0000)
apps/tests/TestSimTimers/TestTimerC.nc

index aab5ffe6559a7afad52d8159a79cbb22d3b0ce14..ee18f71a1254730f2dedc0457e9901292cbbbfce 100644 (file)
@@ -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();
   }