可轮询
if((huart2.Instance->CR1 & 0x20)==0) //判断是否关闭了中断标志
{
printf(“clean error!!!\r\n”);
HAL_UART_Receive_IT(&huart2, (u8 *)aRxBuffer, 1);//该函数会开启接收中断:标志位UART_IT_RXNE,并且设置接收缓冲以及接收缓冲接收最大数据量
}
02-09
6168
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-14
5938
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-20
1388
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-31
2万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-24
4481
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-26
1763
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)