if((RC1IE)&&(RC1IF)) //串口1
//if(RC1IF == 1)
{
RC1IF = 0;
buffer = RCREG1;
if(*buffer == ‘\0’)
{
Uart1Sends(“buffer is :0\n”);
DelayuS(100000);
}
else
{
Uart1Sends(buffer);
Uart1Sends(“buffer is not 0 \n”);
DelayuS(100000);
}
buffer = “\0”;
if(OERR1)
{
CREN1=0;
CREN1=1;
}
中断中的代码如上,我用烧录后串口一直在发不固定的值和buffer is not 0,用串口调试助手发东西没有作用。有大佬帮助一下吗?谢谢了。