|
当从虚拟串口到真实串口发数据时,没有错误,但发送一个稍微大一点的文件时(如1M),误码率很高。不知是为什么?
其中:
int main(void)
{
#ifdef DEBUG
debug();
#endif
Set_System();
Set_USBClock();
USB_Interrupts_Config();
USB_Init();
while (1)
{
if (count_out != 0)
{
USB_To_USART_Send_Data(&buffer_out[0], count_out);//这句是发数据的函数,原型如下。
count_out = 0;
}
}
}
其中:
void USB_To_USART_Send_Data(u8* data_buffer, u8 Nb_bytes)
{
u32 i;
for (i = 0; i < Nb_bytes; i++)
{
USART_SendData(USART1, *(data_buffer + i));
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET); //add by sun zhilong
}
}
望高手指教。 |
|