\r
/* Send the data in the OUT pipe to the attached device */\r
Pipe_ClearOUT();\r
-\r
- /* Some buggy devices require a delay here before the pipe freezing or they will lock up */\r
- USB_Host_WaitMS(1);\r
\r
+ while(!(Pipe_IsOUTReady()));\r
+\r
/* Freeze pipe after use */\r
Pipe_Freeze();\r
\r
\r
/* Acknowledge the packet */\r
Pipe_ClearOUT();\r
+ \r
+ while (!(Pipe_IsOUTReady()));\r
}\r
-\r
- /* Some buggy devices require a delay here before the pipe freezing or they will lock up */\r
- USB_Host_WaitMS(1);\r
\r
/* Freeze used pipe after use */\r
Pipe_Freeze();\r
uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;\r
\r
/* If an error in the command ocurred, abort */\r
- if ((ErrorCode == MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ErrorCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)\r
return ErrorCode;\r
\r
/* Select the IN data pipe for data reception */\r
\r
/* Clear the data ready for next reception */\r
Pipe_ClearIN();\r
-\r
- /* Some buggy devices require a delay here before the pipe freezing or they will lock up */\r
- USB_Host_WaitMS(1);\r
\r
/* Freeze the IN pipe after use */\r
Pipe_Freeze();\r
{\r
.Signature = CBW_SIGNATURE,\r
.Tag = MassStore_Tag,\r
- .DataTransferLength = 8,\r
+ .DataTransferLength = sizeof(SCSI_Capacity_t),\r
.Flags = COMMAND_DIRECTION_DATA_IN,\r
.LUN = LUNIndex,\r
.SCSICommandLength = 10\r
MassStore_SendCommand();\r
\r
/* Read in the returned CSW from the device */\r
- if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_GetReturnedStatus()))\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r