keil_examples/USBMem/mscuser.c
/*
 *  Perform Data IN Transfer
 *    Parameters:      None (global variables)
 *    Return Value:    TRUE - Success, FALSE - Error
 */
Perform Data IN Transfer
Parameters:      None (global variables)
Return Value:    TRUE - Success, FALSE - Error
Perform Data IN Transfer Parameters : None ( global variables ) Return Value : TRUE - Success FALSE - Error
void DataInTransfer (void) {
  if (BulkLen >= CBW.dDataLength) {
    BulkLen = CBW.dDataLength;
    BulkStage = MSC_BS_DATA_IN_LAST;
  }
  else {
    BulkStage = MSC_BS_DATA_IN_LAST_STALL; 
  }
  USB_WriteEP(MSC_EP_IN, BulkBuf, BulkLen);
  CSW.dDataResidue -= BulkLen;
  CSW.bStatus = CSW_CMD_PASSED;
}
void DataInTransfer ( void ) { if ( BulkLen >= CBW . dDataLength ) { BulkLen = CBW . dDataLength ; BulkStage = MSC_BS_DATA_IN_LAST ; } else { BulkStage = MSC_BS_DATA_IN_LAST_STALL ; } USB_WriteEP ( MSC_EP_IN , BulkBuf , BulkLen ) ; CSW . dDataResidue -= BulkLen ; CSW . bStatus = CSW_CMD_PASSED ; }
Perform Data IN Transfer
    Parameters:      None (global variables)
    Return Value:    TRUE - Success, FALSE - Error
Perform Data IN Transfer Parameters : None ( global variables ) Return Value : TRUE - Success FALSE - Error
/* short or zero packet */