send_time++;
if(send_time==10)
{
send_time=0;
UART1_Cmd(DISABLE);
UART1->BRR2 = 0X17;
UART1->BRR1 = 0X04;
UART1_Cmd(ENABLE);
}
if(send_time==5)
{
UART1_Cmd(DISABLE);
UART1->BRR2 = 0X02;
UART1->BRR1 = 0X41;
UART1_Cmd(ENABLE);
}
if(send_time<5)UART1_SendData8(0X55);
else UART1_SendData8(0X77);
请教下大家,运行中怎么切换串口波特率,像我上面这样切换的话,会出现问题,
在切换后第1个数据发送时,前面会多出个1个低电平,时间还不短,
|