projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Oops - ensure the SCSI transfer length is correct in the Mass Storage bootloader.
[pub/USBasp.git]
/
Bootloaders
/
MassStorage
/
Lib
/
SCSI.c
diff --git
a/Bootloaders/MassStorage/Lib/SCSI.c
b/Bootloaders/MassStorage/Lib/SCSI.c
index
b23a5a0
..
eeb2c25
100644
(file)
--- 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 */
}
/* 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)
{
if (IsDataRead == DATA_READ)
- VirtualFAT_ReadBlock(BlockAddress);
+ VirtualFAT_ReadBlock(BlockAddress
+ i
);
else
else
- VirtualFAT_WriteBlock(BlockAddress);
-
- BlockAddress++;
+ VirtualFAT_WriteBlock(BlockAddress + i);
}
/* Update the bytes transferred counter and succeed the command */
}
/* Update the bytes transferred counter and succeed the command */