- /* Save the new firmware file block offset so the written and read file
- * contents can be correctly mapped to the device's FLASH pages */
- FileStartBlock = DISK_BLOCK_DataStartBlock +
- (FirmwareFileEntries[DISK_FILE_ENTRY_FirmwareMSDOS].MSDOS_File.StartingCluster - 2) * SECTOR_PER_CLUSTER;
- }
- else
- {
- ReadWriteFirmwareFileBlock(BlockNumber, BlockBuffer, false);
+ break;
+
+ case DISK_BLOCK_RootFilesBlock:
+ /* Copy over the updated directory entries */
+ memcpy(FirmwareFileEntries, BlockBuffer, sizeof(FirmwareFileEntries));
+
+ /* Save the new firmware file block offset so the written and read file
+ * contents can be correctly mapped to the device's FLASH pages */
+ FileStartBlock = DISK_BLOCK_DataStartBlock +
+ (FirmwareFileEntries[DISK_FILE_ENTRY_FirmwareMSDOS].MSDOS_File.StartingCluster - 2) * SECTOR_PER_CLUSTER;
+
+ break;
+
+ default:
+ ReadWriteFirmwareFileBlock(BlockNumber, BlockBuffer, false);
+
+ break;