*/\r
static uint8_t MassStore_SendCommand(void)\r
{\r
- uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;\r
+ uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
\r
/* Each transmission should have a unique tag value, excluding values 0 and 0xFFFFFFFF */\r
if (++MassStore_Tag == 0xFFFFFFFF)\r
Pipe_Unfreeze();\r
\r
/* Write the CBW command to the OUT pipe */\r
- if ((ErrorCode = Pipe_Write_Stream_LE(&SCSICommandBlock, sizeof(CommandBlockWrapper_t))) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ErrorCode = Pipe_Write_Stream_LE(&SCSICommandBlock, sizeof(CommandBlockWrapper_t))) != PIPE_RWSTREAM_NoError)\r
return ErrorCode;\r
\r
/* Send the data in the OUT pipe to the attached device */\r
/* Freeze pipe after use */\r
Pipe_Freeze();\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Waits until the attached device is ready to accept data following a CBW, checking\r
\r
/* Check to see if the timeout period for the command has elapsed */\r
if (!(TimeoutMSRem))\r
- return PIPE_RWSTREAM_ERROR_Timeout;\r
+ return PIPE_RWSTREAM_Timeout;\r
}\r
\r
Pipe_SelectPipe(MASS_STORE_DATA_OUT_PIPE);\r
/* Clear the stall condition on the OUT pipe */\r
MassStore_ClearPipeStall(MASS_STORE_DATA_OUT_PIPE);\r
\r
- return PIPE_RWSTREAM_ERROR_PipeStalled;\r
+ return PIPE_RWSTREAM_PipeStalled;\r
}\r
\r
Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);\r
/* Clear the stall condition on the IN pipe */\r
MassStore_ClearPipeStall(MASS_STORE_DATA_IN_PIPE);\r
\r
- return PIPE_RWSTREAM_ERROR_PipeStalled;\r
+ return PIPE_RWSTREAM_PipeStalled;\r
}\r
\r
/* Check to see if the device was disconnected, if so exit function */\r
if (!(USB_IsConnected))\r
- return PIPE_RWSTREAM_ERROR_DeviceDisconnected;\r
+ return PIPE_RWSTREAM_DeviceDisconnected;\r
};\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Sends or receives the transaction's data stage to or from the attached device, reading or\r
*/\r
static uint8_t MassStore_SendReceiveData(void* BufferPtr)\r
{\r
- uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;\r
+ uint8_t ErrorCode = PIPE_RWSTREAM_NoError;\r
uint16_t BytesRem = SCSICommandBlock.Header.DataTransferLength;\r
\r
/* Check the direction of the SCSI command data stage */\r
Pipe_Unfreeze();\r
\r
/* Read in the block data from the pipe */\r
- if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_NoError)\r
return ErrorCode;\r
\r
/* Acknowledge the packet */\r
Pipe_Unfreeze();\r
\r
/* Write the block data to the pipe */\r
- if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_NoError)\r
return ErrorCode;\r
\r
/* Acknowledge the packet */\r
/* Freeze used pipe after use */\r
Pipe_Freeze();\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Routine to receive the current CSW from the device.\r
*/\r
static uint8_t MassStore_GetReturnedStatus(void)\r
{\r
- uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;\r
+ uint8_t ErrorCode = PIPE_RWSTREAM_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_NoError)\r
return ErrorCode;\r
\r
/* Select the IN data pipe for data reception */\r
Pipe_Unfreeze();\r
\r
/* Load in the CSW from the attached device */\r
- if ((ErrorCode = Pipe_Read_Stream_LE(&SCSICommandStatus, sizeof(CommandStatusWrapper_t))) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ErrorCode = Pipe_Read_Stream_LE(&SCSICommandStatus, sizeof(CommandStatusWrapper_t))) != PIPE_RWSTREAM_NoError)\r
return ErrorCode;\r
\r
/* Clear the data ready for next reception */\r
/* Freeze the IN pipe after use */\r
Pipe_Freeze();\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Clears the stall condition in the attached device on the nominated endpoint number.\r
*/\r
uint8_t MassStore_RequestSense(const uint8_t LUNIndex, const SCSI_Request_Sense_Response_t* const SensePtr)\r
{\r
- uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;\r
+ uint8_t ReturnCode = PIPE_RWSTREAM_NoError;\r
\r
/* Create a CBW with a SCSI command to issue REQUEST SENSE command */\r
SCSICommandBlock = (CommandBlockWrapper_t)\r
MassStore_SendCommand();\r
\r
/* Wait until data received from the device */\r
- if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
}\r
\r
/* Read the returned sense data into the buffer */\r
- if ((ReturnCode = MassStore_SendReceiveData((uint8_t*)SensePtr)) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_SendReceiveData((uint8_t*)SensePtr)) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
} \r
\r
/* Read in the returned CSW from the device */\r
- if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Issues a SCSI Device Block Read command to the attached device, to read in one or more data blocks from the\r
uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress,\r
const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr)\r
{\r
- uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;\r
+ uint8_t ReturnCode = PIPE_RWSTREAM_NoError;\r
\r
/* Create a CBW with a SCSI command to read in the given blocks from the device */\r
SCSICommandBlock = (CommandBlockWrapper_t)\r
MassStore_SendCommand();\r
\r
/* Wait until data received from the device */\r
- if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
}\r
\r
/* Read the returned block data into the buffer */\r
- if ((ReturnCode = MassStore_SendReceiveData(BufferPtr)) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_SendReceiveData(BufferPtr)) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
} \r
\r
/* Read in the returned CSW from the device */\r
- if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Issues a SCSI Device Block Write command to the attached device, to write one or more data blocks to the\r
uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress,\r
const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr)\r
{\r
- uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;\r
+ uint8_t ReturnCode = PIPE_RWSTREAM_NoError;\r
\r
/* Create a CBW with a SCSI command to write the given blocks to the device */\r
SCSICommandBlock = (CommandBlockWrapper_t)\r
MassStore_SendCommand();\r
\r
/* Write the data to the device from the buffer */\r
- if ((ReturnCode = MassStore_SendReceiveData(BufferPtr)) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_SendReceiveData(BufferPtr)) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
} \r
\r
/* Read in the returned CSW from the device */\r
- if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Issues a SCSI Device Test Unit Ready command to the attached device, to determine if the device is ready to accept\r
*/\r
uint8_t MassStore_TestUnitReady(const uint8_t LUNIndex)\r
{\r
- uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError; \r
+ uint8_t ReturnCode = PIPE_RWSTREAM_NoError; \r
\r
/* Create a CBW with a SCSI command to issue TEST UNIT READY command */\r
SCSICommandBlock = (CommandBlockWrapper_t)\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()) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Issues a SCSI Device Read Capacity command to the attached device, to determine the capacity of the\r
*/\r
uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, SCSI_Capacity_t* const CapacityPtr)\r
{\r
- uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;\r
+ uint8_t ReturnCode = PIPE_RWSTREAM_NoError;\r
\r
/* Create a CBW with a SCSI command to issue READ CAPACITY command */\r
SCSICommandBlock = (CommandBlockWrapper_t)\r
MassStore_SendCommand();\r
\r
/* Wait until data received from the device */\r
- if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
}\r
\r
/* Read the returned capacity data into the buffer */\r
- if ((ReturnCode = MassStore_SendReceiveData(CapacityPtr)) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_SendReceiveData(CapacityPtr)) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
CapacityPtr->BlockSize = SwapEndian_32(CapacityPtr->BlockSize);\r
\r
/* Read in the returned CSW from the device */\r
- if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_ERROR_NoError)\r
+ if ((ReturnCode = MassStore_GetReturnedStatus()) != PIPE_RWSTREAM_NoError)\r
{\r
Pipe_Freeze();\r
return ReturnCode;\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
/** Issues a SCSI Device Prevent/Allow Medium Removal command to the attached device, to lock the physical media from\r
*/\r
uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, const bool PreventRemoval)\r
{\r
- uint8_t ReturnCode = PIPE_RWSTREAM_ERROR_NoError;\r
+ uint8_t ReturnCode = PIPE_RWSTREAM_NoError;\r
\r
/* Create a CBW with a SCSI command to issue PREVENT ALLOW MEDIUM REMOVAL command */\r
SCSICommandBlock = (CommandBlockWrapper_t)\r
return ReturnCode;\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r