[Tinyos-beta-commits] CVS: tinyos-1.x/beta/AT45DB/tests RandRW.nc,
1.1, 1.2
David Gay
idgay at users.sourceforge.net
Tue Jun 7 09:58:51 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/beta/AT45DB/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15815/tests
Modified Files:
RandRW.nc
Log Message:
do r, w, or r&w depending on local address
Index: RandRW.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/AT45DB/tests/RandRW.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RandRW.nc 7 Jun 2005 00:30:24 -0000 1.1
--- RandRW.nc 7 Jun 2005 16:58:33 -0000 1.2
***************
*** 1,2 ****
--- 1,8 ----
+ /*
+ address & 3:
+ 0, 2: r
+ 1: w
+ 3: r&w
+ */
module RandRW {
provides interface StdControl;
***************
*** 45,51 ****
void resetSeed() {
! shiftReg = 119 * 119 * (TOS_LOCAL_ADDRESS + 1);
initSeed = shiftReg;
! mask = 137 * 29 * (TOS_LOCAL_ADDRESS + 1);
}
--- 51,57 ----
void resetSeed() {
! shiftReg = 119 * 119 * ((TOS_LOCAL_ADDRESS >> 2) + 1);
initSeed = shiftReg;
! mask = 137 * 29 * ((TOS_LOCAL_ADDRESS >> 2) + 1);
}
***************
*** 127,132 ****
if (scheck(result))
{
! state = S_ERASE;
! rcheck(call BlockWrite.erase());
}
}
--- 133,146 ----
if (scheck(result))
{
! if (TOS_LOCAL_ADDRESS & 1)
! {
! state = S_ERASE;
! rcheck(call BlockWrite.erase());
! }
! else
! {
! state = S_VERIFY;
! rcheck(call BlockRead.verify());
! }
}
}
***************
*** 151,157 ****
if (scheck(result))
{
! call Leds.yellowToggle();
! state = S_VERIFY;
! rcheck(call BlockRead.verify());
}
}
--- 165,176 ----
if (scheck(result))
{
! if (TOS_LOCAL_ADDRESS & 2)
! {
! call Leds.yellowToggle();
! state = S_VERIFY;
! rcheck(call BlockRead.verify());
! }
! else
! call Leds.greenOn();
}
}
More information about the Tinyos-beta-commits
mailing list