void USART2_IRQHandler(void)
{
int res ;
if((USART_GetITStatus(USART2, USART_IT_RXNE) != RESET)) //½ÓÊÕµ½Êý¾Ý
{
res=USART_ReceiveData(USART2);
Uart_PushData(2,res);
if(UartPro[2].Reveive_Uuff[0]==0x7e&&UartPro[2].Reveive_Uuff[1]==0x7d&&UartPro[2].Reveive_Uuff[3]==0x00)
RS485Flag=1;
if(UartPro[2].Reveive_Uuff[0]==0x7e&&UartPro[2].Reveive_Uuff[1]==0x7d&&UartPro[2].Reveive_Uuff[3]==0x01)
RS485Flag=2;
if(UartPro[2].Reveive_Uuff[0]==0x7e&&UartPro[2].Reveive_Uuff[1]==0x7d&&UartPro[2].Reveive_Uuff[3]==0x02)
RS485Flag=3;
if(UartPro[2].Reveive_Uuff[0]==0x7e&&UartPro[2].Reveive_Uuff[1]==0x7d&&UartPro[2].Reveive_Uuff[3]==0x03)
RS485Flag=4;
if(UartPro[2].Reveive_Uuff[0]==0x7e&&UartPro[2].Reveive_Uuff[1]==0x7d&&UartPro[2].Reveive_Uuff[3]==0x20)
RS485Flag=5;
}
}
|
|