/* Get the received data buffer and update the counter */
USB_Rx_Cnt = USB_SIL_Read(EP3_OUT, USB_Rx_Buffer);//获得接收到的数据长度,同时将数据从USB EP3 RX的缓冲区拷贝到用户指定的数组中
/* USB data will be immediately processed, this allow next USB traffic being
NAKed till the end of the USART Xfer */
len=USBHostDataProcess((USBHOSTDATA*)USB_Rx_Buffer);//读写数据处理
SetEPRxValid(ENDP3);
//SetEPRxValid(ENDP3);
/*返回数据给usb主机*/
USB_SIL_Write(EP1_IN, USB_Rx_Buffer,len);
SetEPTxValid(ENDP1);
}
if(bDeviceState == CONFIGURED)
{
if (FrameCount++ == VCOMPORT_IN_FRAME_INTERVAL)
{
/* Reset the frame counter */
FrameCount = 0;
/* Check the data to be sent through IN pipe */
//Handle_USBAsynchXfer();
}
}
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/