我用官方的虚拟串口例子,跑起来速度只有90多kbps是小b,大家是怎么测出来速度的,我怕我测的不对。
另外程序中串口输出占用了很大的时间,去掉USB_To_USART_Send_Data(USB_Rx_Buffer, USB_Rx_Cnt);可以达到300多kbps
void EP3_OUT_Callback(void)
{
uint16_t USB_Rx_Cnt;
/* Get the received data buffer and update the counter */
USB_Rx_Cnt = USB_SIL_Read(EP3_OUT, USB_Rx_Buffer);
/* USB data will be immediately processed, this allow next USB traffic being
NAKed till the end of the USART Xfer */
USB_To_USART_Send_Data(USB_Rx_Buffer, USB_Rx_Cnt);
/* Enable the receive of data on EP3 */
SetEPRxValid(ENDP3);
}
后来改成双缓冲,不加USB_To_USART_Send_Data(USB_Rx_Buffer, USB_Rx_Cnt);这句,可以达到7M多bps,加了后还是90多kbps,问下大家有什么解决方法吗? |