/* Writes a block of data to the virtual FAT filesystem, from the USB Mass Storage interface. */
void VirtualFAT_WriteBlock(const uint16_t BlockNumber)
/* Writes a block of data to the virtual FAT filesystem, from the USB Mass Storage interface. */
void VirtualFAT_WriteBlock(const uint16_t BlockNumber)
{
	uint8_t BlockBuffer[SECTOR_SIZE_BYTES];
	Endpoint_Read_Stream_LE(BlockBuffer, sizeof(BlockBuffer), NULL);
	Endpoint_ClearOUT();
	switch (BlockNumber)
	{
		case DISK_BLOCK_BootBlock:
		case DISK_BLOCK_FATBlock1:
		case DISK_BLOCK_FATBlock2:
			break;
		case DISK_BLOCK_RootFilesBlock:
			memcpy(FirmwareFileEntries, BlockBuffer, sizeof(FirmwareFileEntries));
			break;
		default:
			ReadWriteFLASHFileBlock(BlockNumber, BlockBuffer, false);
			ReadWriteEEPROMFileBlock(BlockNumber, BlockBuffer, false);
			break;
	}
}