void UART5_IRQHandler(void) //串口1中断服务程序
{
u8 Res;
if(USART_GetITStatus(UART5, USART_IT_RXNE) != RESET) //接收中断(接收到的数据必须是0x0d 0x0a结尾)
{
Res =USART_ReceiveData(UART5);//(USART1->DR); //读取接收到的数据
USART_RX_BUF[USART_RX_STA++]=Res;
}
}
if(USART_RX_STA>5)
{
// printf("%s",USART_RX_BUF);
while(USART_RX_STA--)
{
USART_SendData(UART5,USART_RX_BUF[im++]);
while(USART_GetFlagStatus(UART5, USART_FLAG_TC)==RESET );
}
USART_RX_STA=0;
im=0;
}