X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2FDeluge%2FFlashVolumeManager%2FFlashVolumeManagerP.nc;fp=tos%2Flib%2Fnet%2FDeluge%2FFlashVolumeManager%2FFlashVolumeManagerP.nc;h=2021f2e0a6ca549b01b1fa6e4b7d796b183677b3;hb=da393f0d6e7bca649d8d0ce0894cb1ad10ba4212;hp=216c00d2f9685dfd93ac91b57d4ca6d3e117f12c;hpb=54266a2025b5e1246459c8d625b96f3294362425;p=tinyos-2.x.git diff --git a/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc b/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc index 216c00d2..2021f2e0 100644 --- a/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc +++ b/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc @@ -58,6 +58,7 @@ implementation S_READ, S_CRC, S_REPROG, + S_SYNC, }; message_t serialMsg; @@ -130,7 +131,7 @@ implementation event void BlockWrite.syncDone[uint8_t img_num](error_t error) { - if (state == S_ERASE) { + if (state == S_ERASE || state == S_SYNC) { state = S_IDLE; sendReply(error, sizeof(SerialReplyPacket)); } @@ -180,6 +181,9 @@ implementation error = call BlockRead.computeCrc[img_num](srpkt->offset, srpkt->len, 0); break; + case SERIALMSG_SYNC: // === Sync the flash === + state = S_SYNC; + error = call BlockWrite.sync[img_num](); #ifdef DELUGE case SERIALMSG_ADDR: // === Gets the physical starting address of a volume === *(nx_uint32_t*)(&serialMsg_payload->data) =