stm32串口485的中断接收到的和发送的不一致,是怎么回事,波特率设置这些正常,求大侠指点呀!!!
voidUSART3_IRQHandler(void){if(USART_GetITStatus(USART3,USART_IT_RXNE)!=RESET)//查询是否为...
void USART3_IRQHandler(void)
{
if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)//查询是否为秒中断标志
{u8 i=0,rbuff[100];
LED_open();
t=USART3_ReceiveData();//
USART3_SendData(t);
// while(USART3_ReceiveData()!=0xaa);//寻找帧头
// t=USART3_ReceiveData();
// while(t!=0xbb)//若是没到帧尾就继续接收
// {rbuff[i++]=t;
// t=USART3_ReceiveData();}
// for(u16 j=0;j<i;j++)USART1_SendData(rbuff[j]);//把接收到的数据发送出*/
USART_ClearITPendingBit(USART3,USART_IT_RXNE); //清中断标识
}
} 展开
{
if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)//查询是否为秒中断标志
{u8 i=0,rbuff[100];
LED_open();
t=USART3_ReceiveData();//
USART3_SendData(t);
// while(USART3_ReceiveData()!=0xaa);//寻找帧头
// t=USART3_ReceiveData();
// while(t!=0xbb)//若是没到帧尾就继续接收
// {rbuff[i++]=t;
// t=USART3_ReceiveData();}
// for(u16 j=0;j<i;j++)USART1_SendData(rbuff[j]);//把接收到的数据发送出*/
USART_ClearITPendingBit(USART3,USART_IT_RXNE); //清中断标识
}
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询