Information Technology Reference
In-Depth Information
// Increment the pointer to the next data to send.
ptrNextData += MSD_IN_EP_SIZE;
} else
{
if (msd_csw.bCSWStatus != 0x0)
{
// bCSWStatus indicates an error.
// Set size to the lower of the endpoint size or dCBWDataTransferLength.
size = mMin (MSD_IN_EP_SIZE, gblCBW.dCBWDataTransferLength);
// Reset msd_buffer's contents to zeroes to send pad data.
for (i = 0; i < size; i++) msd_buffer[i] = 0;
if (gblCBW.dCBWDataTransferLength > MSD_IN_EP_SIZE)
{
// There was an error (bCSWStatus != 0x0)
// and dCBWDataTransferLength is greater than the endpoint size.
// Send MSD_IN_EP_SIZE bytes from msd_buffer.
SendData((byte*)&msd_buffer[0], MSD_IN_EP_SIZE);
// Subtract the sent bytes from dCBWDataTransferLength in the CBW.
gblCBW.dCBWDataTransferLength -= MSD_IN_EP_SIZE;
// Subtract the sent bytes from dCSWDataResidue in the CSW.
msd_csw.dCSWDataResidue -= MSD_IN_EP_SIZE;
Search WWH ::




Custom Search