X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/148b434228cfa94160cc1dbfafc455fd86825fa1..83d5c4729e3cb014d2f75a5ac4132658ad6b7ea8:/Bootloaders/MassStorage/Lib/SCSI.c diff --git a/Bootloaders/MassStorage/Lib/SCSI.c b/Bootloaders/MassStorage/Lib/SCSI.c index ea0700a27..b23a5a07b 100644 --- a/Bootloaders/MassStorage/Lib/SCSI.c +++ b/Bootloaders/MassStorage/Lib/SCSI.c @@ -255,10 +255,15 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa } /* Determine if the packet is a READ (10) or WRITE (10) command, call appropriate function */ - if (IsDataRead == DATA_READ) - VirtualFAT_ReadBlocks(BlockAddress, TotalBlocks); - else - VirtualFAT_WriteBlocks(BlockAddress, TotalBlocks); + while (TotalBlocks--) + { + if (IsDataRead == DATA_READ) + VirtualFAT_ReadBlock(BlockAddress); + else + VirtualFAT_WriteBlock(BlockAddress); + + BlockAddress++; + } /* Update the bytes transferred counter and succeed the command */ MSInterfaceInfo->State.CommandBlock.DataTransferLength -= ((uint32_t)TotalBlocks * SECTOR_SIZE_BYTES);