This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc3220sf 串口工作一段时间就会出现接收超时,一直调用串口中断,导致程序无法工作,问题代码如下,该怎么处理??



代码如下:

uartHandle0 = UART_open(Board_UART0, &uartParams);

UARTFIFODisable(UARTA0_BASE);//使能fifo
UARTIntRegister(UARTA0_BASE,Uart0_ISR);//设置中断回调函数
UARTIntEnable(UARTA0_BASE,UART_INT_RX);//设置接收中断

//UARTIntClear(UARTA0_BASE, UART_INT_RT);
//UARTIntEnable(UARTA0_BASE, UART_INT_RT);

static void Uart0_ISR(void)
{
unsigned long ulStatus;
uint8_t data0;

//获取经过屏蔽的中断状态
ulStatus = UARTIntStatus(UARTA0_BASE,1);
//中断标志

UARTCharPut(UARTA0_BASE,ulStatus);
if(ulStatus & UART_INT_RX)
{
//判断FIFO有没有数据
while(UARTCharsAvail(UARTA0_BASE))
{
//获取接收的数据,并直接再发送
// UARTCharPut(UARTA0_BASE,UARTCharGet(UARTA0_BASE));
data0 = UARTCharGet(UARTA0_BASE);
// unsigned long ulStatus;
}
//清除中断标志位
UARTIntClear(UARTA0_BASE,UART_INT_RX);
}
//else  if(ulStatus & UART_INT_RT)
//{
 //UARTIntClear(UARTA0_BASE,UART_INT_RT);
//UARTRxErrorClear(UARTA0_BASE);
//}

}