- break;
- case SERIALMSG_READ: // === Reads a portion of a volume ===
- state = S_READ;
- error = call BlockRead.read[img_num](srpkt->offset,
- serialMsg_payload->data,
- srpkt->len);
- break;
- case SERIALMSG_CRC: // === Computes CRC over a portion of a volume ===
- state = S_CRC;
- error = call BlockRead.computeCrc[img_num](srpkt->offset,
- srpkt->len, 0);
- break;
- case SERIALMSG_ADDR: // === Gets the physical starting address of a volume ===
- *(nx_uint32_t*)(&serialMsg_payload->data) =
- (uint32_t)call DelugeStorage.getPhysicalAddress[img_num](0);
- sendReply(SUCCESS, sizeof(SerialReplyPacket) + 4);
- break;
-#ifdef DELUGE
- case SERIALMSG_REPROG: // === Reboots and reprograms ===
- state = S_REPROG;
- sendReply(SUCCESS, sizeof(SerialReplyPacket));
- img_num_reboot = img_num;
- call Timer.startOneShot(1024);
- break;
- case SERIALMSG_DISS: // === Starts disseminating a volume ===
- signal Notify.notify(img_num); // Notifies Deluge to start disseminate
- sendReply(SUCCESS, sizeof(SerialReplyPacket));
- break;
-#endif
+ break;
+ case SERIALMSG_CRC: // === Computes CRC over a portion of a volume ===
+ state = S_CRC;
+ error = call BlockRead.computeCrc[img_num](srpkt->offset,
+ srpkt->len, 0);
+ break;
+ #ifdef DELUGE
+ case SERIALMSG_ADDR: // === Gets the physical starting address of a volume ===
+ *(nx_uint32_t*)(&serialMsg_payload->data) =
+ (uint32_t)call DelugeStorage.getPhysicalAddress[img_num](0);
+ sendReply(SUCCESS, sizeof(SerialReplyPacket) + 4);
+ break;
+ case SERIALMSG_REPROG: // === Reboots and reprograms ===
+ state = S_REPROG;
+ sendReply(SUCCESS, sizeof(SerialReplyPacket));
+ img_num_reboot = img_num;
+ call Timer.startOneShot(1024);
+ break;
+ case SERIALMSG_DISS: // === Starts disseminating a volume ===
+ signal Notify.notify(img_num); // Notifies Deluge to start disseminate
+ sendReply(SUCCESS, sizeof(SerialReplyPacket));
+ break;
+ #endif
+ }
+ } else {
+ error = FAIL;