X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2FDeluge%2FFlashVolumeManager%2FFlashVolumeManagerP.nc;h=4ed7a64b9a7bd722e684cc69c5da77731597fb3f;hb=041ffc35f76c6bb25838ec4953a5963c10d9328c;hp=138c6b02ec361cc5316a3fe3fec833d5f11c4515;hpb=ec690f3f7e3fa45a9865e618f2e609683633b95f;p=tinyos-2.x.git diff --git a/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc b/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc index 138c6b02..4ed7a64b 100644 --- a/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc +++ b/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc @@ -87,6 +87,13 @@ implementation nx_uint32_t uidhash; nx_uint16_t nodeid; }; + + uint8_t imgNum2volumeId[] = { + VOLUME_GOLDENIMAGE, + VOLUME_DELUGE1, + VOLUME_DELUGE2, + VOLUME_DELUGE3 + }; void sendReply(error_t error, storage_len_t len) { @@ -179,20 +186,7 @@ implementation } // Converts the image number that the user wants to the real image number - switch (request->imgNum) { - case 0: - imgNum = VOLUME_GOLDENIMAGE; - break; - case 1: - imgNum = VOLUME_DELUGE1; - break; - case 2: - imgNum = VOLUME_DELUGE2; - break; - case 3: - imgNum = VOLUME_DELUGE3; - break; - } + imgNum = imgNum2volumeId[request->imgNum]; if (imgNum != 0xFF) { error = SUCCESS;