/* The created task to handle the USB demo functionality.  */
void vUSBDemoTask(void *pvParameters)
/* The created task to handle the USB demo functionality.  */
void vUSBDemoTask(void *pvParameters)
{
xISRStatus *pxMessage;
	( void ) pvParameters;
    portENTER_CRITICAL();
	    vInitUSBInterface();
    portEXIT_CRITICAL();
	for( ;; )
	{
		if( xQueueReceive( xUSBInterruptQueue, &pxMessage, usbSHORT_DELAY ) )
		{
			if( pxMessage->ulISR & AT91C_UDP_EPINT0 )
			{
				prvProcessEndPoint0Interrupt( pxMessage );
			}
			if( pxMessage->ulISR & AT91C_UDP_ENDBUSRES )
			{
				prvResetEndPoints();			}
		}
		else
		{
			if( eDriverState == eREADY_TO_SEND )
			{
				prvTransmitSampleValues();
			}
		}
	}
}