根据串口例程修改的两串口程序,串口1接收数据有问题。

[复制链接]
 楼主| 过期账户 发表于 2019-11-24 14:08 | 显示全部楼层 |阅读模式
求大神看看问题出在哪里
void USART1_IRQHandler(void)
{
        uint8_t ch_U1;
        
        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
        {         
                        ch_U1 = USART_ReceiveData(USART1);
                  if(isnRF51begin == false)
                        {
                                        if(ch_U1 ==0xFF)
                                        {
                                                isnRF51begin = true;
                                                RxBuffer1[RxCounter1] = ch_U1;
                                                RxCounter1++;        
                                        }
                                        else {return;}        
                        }               
      else        
                                {   //Delay(100);
                                                RxBuffer1[RxCounter1] = ch_U1;
                                                RxCounter1++;        
                                }               
                         if(RxCounter1 >= 8)
                                        {
                                                RxCounter1 = 0;
                                                isnRF51begin=false;
                                                rx_nRF51_flag = true;
                                        }
                                else{}
        }
         
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

395

主题

395

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部