X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/3ecc4629540c72f1db293c5725faf3106935731d..b7eead83aab675ebfe583c5beb1662e2d1833cb8:/Demos/Device/LowLevel/MassStorage/MassStorage.c diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c index cf276fd81..76aa337c7 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.c +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c @@ -189,15 +189,15 @@ void MassStorage_Task(void) if (CommandBlock.Flags & COMMAND_DIRECTION_DATA_IN) Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM); - /* Decode the received SCSI command */ - SCSI_DecodeSCSICommand(); + /* Decode the received SCSI command, set returned status code */ + CommandStatus.Status = SCSI_DecodeSCSICommand() ? Command_Pass : Command_Fail; /* Load in the CBW tag into the CSW to link them together */ CommandStatus.Tag = CommandBlock.Tag; /* Load in the data residue counter into the CSW */ CommandStatus.DataTransferResidue = CommandBlock.DataTransferLength; - + /* Stall the selected data pipe if command failed (if data is still to be transferred) */ if ((CommandStatus.Status == Command_Fail) && (CommandStatus.DataTransferResidue)) Endpoint_StallTransaction();