From 286c128240dd8683a24669bfa4408b3466cd73aa Mon Sep 17 00:00:00 2001 From: razvanm Date: Mon, 22 Feb 2010 09:26:40 +0000 Subject: [PATCH] Fix a bug in the checking of the Deluge volumes. --- tos/lib/net/Deluge/DelugeMetadataP.nc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(); } } -- 2.39.2