[Tinyos-commits] CVS: tinyos-1.x/tos/lib/Deluge DelugeM.nc, 1.57,
1.58
Jonathan Hui
jwhui at users.sourceforge.net
Thu Sep 1 15:01:12 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/Deluge
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7712
Modified Files:
DelugeM.nc
Log Message:
- Don't start advs until images are read in.
Index: DelugeM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/Deluge/DelugeM.nc,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** DelugeM.nc 18 Aug 2005 17:31:55 -0000 1.57
--- DelugeM.nc 1 Sep 2005 22:01:09 -0000 1.58
***************
*** 117,122 ****
void checkReboot() {
DelugeImgDesc* imgDesc = call Metadata.getImgDesc(nodeDesc.imgNum);
! if ( nodeDesc.uid != DELUGE_IMAGE_UID
! && nodeDesc.uid == imgDesc->uid
&& imgDesc->numPgsComplete == imgDesc->numPgs
&& imgDesc->numPgs )
--- 117,121 ----
void checkReboot() {
DelugeImgDesc* imgDesc = call Metadata.getImgDesc(nodeDesc.imgNum);
! if ( nodeDesc.uid == imgDesc->uid
&& imgDesc->numPgsComplete == imgDesc->numPgs
&& imgDesc->numPgs )
***************
*** 160,175 ****
void realStart() {
setNextPage();
call PageTransferControl.start();
}
command result_t StdControl.start() {
! int i;
if ( state == S_STOPPED )
realStart();
state = S_STARTED;
! for ( i = 0; i < DELUGE_NUM_TIMERS; i++ )
! resetTimer(i);
return SUCCESS;
}
--- 159,184 ----
void realStart() {
+
+ int i;
+
setNextPage();
call PageTransferControl.start();
+
+ for ( i = 1; i < DELUGE_NUM_TIMERS; i++ )
+ resetTimer(i);
+
}
command result_t StdControl.start() {
!
if ( state == S_STOPPED )
realStart();
+
state = S_STARTED;
!
! resetTimer( 0 );
!
return SUCCESS;
+
}
***************
*** 221,226 ****
imgDesc->vNum = DELUGE_INVALID_VNUM;
imgDesc->imgNum = imgNum;
- imgDesc->numPgs = 0;
- imgDesc->numPgsComplete = 0;
}
memcpy(&pMsg->imgDesc, imgDesc, sizeof(DelugeImgDesc));
--- 230,233 ----
***************
*** 281,285 ****
if ( rxAdvMsg->version != DELUGE_VERSION
! || !isNodeDescValid(&rxAdvMsg->nodeDesc) )
return pMsg;
--- 288,293 ----
if ( rxAdvMsg->version != DELUGE_VERSION
! || !isNodeDescValid(&rxAdvMsg->nodeDesc)
! || state != S_STARTED )
return pMsg;
***************
*** 340,344 ****
// image is larger
else if (cmpImgDesc->numPgsComplete > curImgDesc->numPgsComplete) {
! if (advTimers[imgNum].newAdvs == 0)
call PageTransfer.dataAvailable(rxAdvMsg->sourceAddr, imgNum);
}
--- 348,352 ----
// image is larger
else if (cmpImgDesc->numPgsComplete > curImgDesc->numPgsComplete) {
! if ( advTimers[imgNum].newAdvs == 0 )
call PageTransfer.dataAvailable(rxAdvMsg->sourceAddr, imgNum);
}
More information about the Tinyos-commits
mailing list