X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/83d5c4729e3cb014d2f75a5ac4132658ad6b7ea8..eefbf632d6bdfdee942d3334fea6e7a96e092dde:/Bootloaders/MassStorage/Lib/SCSI.c?ds=sidebyside diff --git a/Bootloaders/MassStorage/Lib/SCSI.c b/Bootloaders/MassStorage/Lib/SCSI.c index b23a5a07b..eeb2c252a 100644 --- a/Bootloaders/MassStorage/Lib/SCSI.c +++ b/Bootloaders/MassStorage/Lib/SCSI.c @@ -255,14 +255,12 @@ 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 */ - while (TotalBlocks--) + for (uint16_t i = 0; i < TotalBlocks; i++) { if (IsDataRead == DATA_READ) - VirtualFAT_ReadBlock(BlockAddress); + VirtualFAT_ReadBlock(BlockAddress + i); else - VirtualFAT_WriteBlock(BlockAddress); - - BlockAddress++; + VirtualFAT_WriteBlock(BlockAddress + i); } /* Update the bytes transferred counter and succeed the command */