From: razvanm Date: Mon, 22 Feb 2010 09:26:40 +0000 (+0000) Subject: Fix a bug in the checking of the Deluge volumes. X-Git-Tag: rc_6_tinyos_2_1_1~5 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=286c128240dd8683a24669bfa4408b3466cd73aa Fix a bug in the checking of the Deluge volumes. --- diff --git a/tos/lib/net/Deluge/DelugeMetadataP.nc b/tos/lib/net/Deluge/DelugeMetadataP.nc index f10b3144..948a4704 100644 --- a/tos/lib/net/Deluge/DelugeMetadataP.nc +++ b/tos/lib/net/Deluge/DelugeMetadataP.nc @@ -71,7 +71,7 @@ implementation { return DELUGE_IDENT_SIZE + currentPage * sizeof(uint16_t); } - + uint32_t calcPageAddr() { return DELUGE_IDENT_SIZE + DELUGE_CRC_BLOCK_SIZE + currentPage * DELUGE_BYTES_PER_PAGE; @@ -87,7 +87,7 @@ implementation state = S_READ_IDENT; currentImageIdx = 0; currentVolume = _imgNum2volumeId[currentImageIdx]; - nextImage(); + nextImage(); } command error_t DelugeMetadata.read[uint8_t client](uint8_t imgNum) @@ -117,6 +117,7 @@ implementation call BlockRead.read[currentVolume](calcCrcAddr(), ¤tCrc, sizeof(currentCrc)); } else { currentImageIdx++; + currentVolume = _imgNum2volumeId[currentImageIdx]; nextImage(); } } @@ -143,7 +144,7 @@ implementation call BlockRead.read[currentVolume](calcCrcAddr(), ¤tCrc, sizeof(currentCrc)); } else { currentImageIdx++; - currentVolume = _imgNum2volumeId[currentImageIdx]; + currentVolume = _imgNum2volumeId[currentImageIdx]; nextImage(); } }