STM32 串口接收字符串问题 20
看网友代码说用IDLE空闲总线可接收不定长字符串,可是我发送一串代码始终只进入了一次RXNE中断,并没有跳入IDLE空闲中断,大神指点下...
看网友代码说用IDLE空闲总线可接收不定长字符串,可是我发送一串代码始终只进入了一次RXNE中断,并没有跳入IDLE空闲中断,大神指点下
展开
1个回答
展开全部
此处附上接收中断源码#ifdef _RAISONANCE_void USART_RX_IRQHandler(void) interrupt 28#endifuint8_t cnt_USART ;#ifdef _IAR_SYSTEMS_#pragma vector=30__interrupt void USART_RX_IRQHandler(void)#endif{/* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */USART_ClearITPendingBit ();//清中断标志if(!USART_GetFlagStatus (USART_FLAG_RXNE))//等待接收完毕{p_rxbuf[cnt_USART++] = USART_ReceiveData8(); //接收数据 if(cnt_USART == 0x0B)cnt_USART = 0xFF ;}// USART_RendCmd(p_rxbuf); //接收11bytes串口指令}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询