/* The data to be transmitted is buffered, the state variables are updated, then prvSendNextSegment() is called to start the transmission off. Once the first segment has been sent the remaining segments are transmitted in response to TXCOMP interrupts until the entire buffer has been sent.  */
static void prvSendControlData(unsigned char *pucData, unsigned short usRequestedLength, unsigned long ulLengthLeftToSend, long lSendingDescriptor)
/* The data to be transmitted is buffered, the state variables are updated, then prvSendNextSegment() is called to start the transmission off. Once the first segment has been sent the remaining segments are transmitted in response to TXCOMP interrupts until the entire buffer has been sent.  */
static void prvSendControlData(unsigned char *pucData, unsigned short usRequestedLength, unsigned long ulLengthLeftToSend, long lSendingDescriptor)
{
	if( ( ( unsigned long ) usRequestedLength < ulLengthToSend ) )
	{
		ulLengthToSend = ( unsigned short ) usRequestedLength;
	}
	else if( ( ulLengthToSend < ( unsigned long ) usRequestedLength ) && lSendingDescriptor )
	{
		if( ( ulLengthToSend % usbFIFO_LENGTH ) == 0 )
		{
			eDriverState = eSENDING_EVEN_DESCRIPTOR;
		}
	}
	memcpy( pxCharsForTx.ucTxBuffer, pucData, ulLengthToSend );
	pxCharsForTx.ulTotalDataLength = ulLengthToSend;
	pxCharsForTx.ulNextCharIndex = ( unsigned long ) 0;
	prvSendNextSegment();
}