[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestNetwork
TestNetworkC.nc, 1.1.2.9, 1.1.2.10
Rodrigo Fonseca
rfonseca76 at users.sourceforge.net
Wed Jun 14 19:11:56 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/apps/tests/TestNetwork
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23099
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
TestNetworkC.nc
Log Message:
Added a staggered first firing of the timer.
Index: TestNetworkC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestNetwork/Attic/TestNetworkC.nc,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -C2 -d -r1.1.2.9 -r1.1.2.10
*** TestNetworkC.nc 14 Jun 2006 14:38:37 -0000 1.1.2.9
--- TestNetworkC.nc 15 Jun 2006 02:11:53 -0000 1.1.2.10
***************
*** 29,32 ****
--- 29,33 ----
uses interface CollectionPacket;
uses interface TreeRoutingInspect;
+ uses interface Random;
}
implementation {
***************
*** 37,40 ****
--- 38,42 ----
uint8_t msglen;
bool busy = FALSE, uartbusy = FALSE;
+ bool firstTimer = TRUE;
event void Boot.booted() {
***************
*** 53,57 ****
call RootControl.setRoot();
}
! call Timer.startPeriodic(1024);
}
}
--- 55,59 ----
call RootControl.setRoot();
}
! call Timer.startOneShot(call Random.rand16() & 0x7FFF);
}
}
***************
*** 62,65 ****
--- 64,71 ----
event void Timer.fired() {
call Leds.led0Toggle();
+ if (firstTimer) {
+ firstTimer = FALSE;
+ call Timer.startPeriodic(1024);
+ }
if (busy || call ReadSensor.read() != SUCCESS) {
signal ReadSensor.readDone(SUCCESS, 0);
More information about the Tinyos-2-commits
mailing list