[Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Deluge/Deluge DelugeM.nc, 1.26, 1.27
Jonathan Hui
jwhui at users.sourceforge.net
Tue Jul 19 11:43:27 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12979
Modified Files:
DelugeM.nc
Log Message:
- Made the reboot logic less aggressive. Previously, the reboot logic
would cause nodes to reboot back to the current image even after a
manual golden gesture reset. There's a tradeoff between nodes always
trying to boot into the same image as their neighbors, and staying in
a specific image because the golden gesture was issued. Without
leaning towards the latter, it is very difficult to bring nodes back
into the golden image manually.
Index: DelugeM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/DelugeM.nc,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** DelugeM.nc 17 Jul 2005 21:09:36 -0000 1.26
--- DelugeM.nc 19 Jul 2005 18:43:15 -0000 1.27
***************
*** 63,71 ****
uint8_t state;
DelugeAdvTimer advTimers[DELUGE_NUM_TIMERS];
DelugeNodeDesc nodeDesc;
-
- uint8_t rebootDelay;
int findMinTimer() {
--- 63,71 ----
uint8_t state;
+ uint8_t rebootDelay;
+ uint8_t curImage;
DelugeAdvTimer advTimers[DELUGE_NUM_TIMERS];
DelugeNodeDesc nodeDesc;
int findMinTimer() {
***************
*** 114,117 ****
--- 114,126 ----
}
+ 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 )
+ rebootDelay = DELUGE_REBOOT_DELAY;
+ }
+
void setNextPage() {
***************
*** 190,199 ****
DelugeImgDesc *imgDesc = call Metadata.getImgDesc(imgNum);
- if ( nodeDesc.uid != DELUGE_IMAGE_UID
- && nodeDesc.uid == imgDesc->uid
- && call Metadata.isComplete(nodeDesc.imgNum)
- && !rebootDelay )
- rebootDelay = DELUGE_REBOOT_DELAY;
-
if (!call SharedMsgBuf.isLocked()) {
pMsg->sourceAddr = TOS_LOCAL_ADDRESS;
--- 199,202 ----
***************
*** 281,285 ****
}
}
!
if ( rxAdvMsg->nodeDesc.vNum != nodeDesc.vNum
&& rxAdvMsg->nodeDesc.vNum != DELUGE_INVALID_VNUM ) {
--- 284,288 ----
}
}
!
if ( rxAdvMsg->nodeDesc.vNum != nodeDesc.vNum
&& rxAdvMsg->nodeDesc.vNum != DELUGE_INVALID_VNUM ) {
***************
*** 292,295 ****
--- 295,300 ----
if ( nodeDesc.imgNum == DELUGE_GOLDEN_IMAGE_NUM )
rebootDelay = DELUGE_REBOOT_DELAY;
+ else
+ checkReboot();
if (rxAdvMsg->type == DELUGE_ADV_PC)
sendAdvMsg(imgNum, rxAdvMsg->sourceAddr);
***************
*** 347,350 ****
--- 352,356 ----
event void PageTransfer.receivedPage(imgnum_t imgNum, pgnum_t pgNum) {
+ curImage = imgNum;
call Metadata.receivedPage(imgNum, pgNum);
}
***************
*** 355,362 ****
event void Metadata.updateDone(result_t result) {
setNextPage();
}
!
event void SharedMsgBuf.bufFree() {}
!
}
--- 361,370 ----
event void Metadata.updateDone(result_t result) {
+ if ( curImage == nodeDesc.imgNum )
+ checkReboot();
setNextPage();
}
!
event void SharedMsgBuf.bufFree() {}
!
}
More information about the Tinyos-beta-commits
mailing list