WCH565串口接收中断只执行一次怎么回事?初始化时已经将串口接收中断打开了,但是接收中断只执行了一次,后面就进不了串口中断了?是怎么回事?
//串口中断配置
UART0_ByteTrigCfg( UART_7BYTE_TRIG );
trigB = 7;
UART0_INTCfg( ENABLE, RB_IER_RECV_RDY|RB_IER_LINE_STAT );
PFIC_EnableIRQ( UART0_IRQn );
void UART0_IRQHandler(void)
{
UINT8 i;
PRINT("INTERRUPT \r\n");
switch( UART0_GetITFlag() )
{
case UART_II_LINE_STAT: //线路状态错误
PRINT("UART0_GetLinSTA()\r\n",UART2_GetLinSTA());
break;
case UART_II_RECV_RDY: //数据达到触发点
for(i=0; i!=trigB; i++)
{
RxBuff[i] = UART0_RecvByte();
//UART0_SendByte(RxBuff[i]);
}
PRINT("get data : %s \r\n",RxBuff);
break;
case UART_II_RECV_TOUT: //接收超时
break;
case UART_II_THR_EMPTY: //发送缓冲区空
break;
default:
break;
}
UART0_CLR_RXFIFO();
} |