USART_FLAG_TXE、USART_FLAG_RXNE这两个标志能用USART_ClearFlag这个函数清楚吗? 在USART Example2中
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) { /* Read one byte from the receive data register */ RxBuffer[RxCounter++] = (USART_ReceiveData(USART1) & 0x7F);
/* Clear the USART1 Receive interrupt */ USART_ClearITPendingBit(USART1, USART_IT_RXNE);// 这句不是多余的吗?而且它也没效果。。
if(RxCounter == NbrOfDataToRead) { /* Disable the USART Receive interrupt */ USART_ITConfig(USART1, USART_IT_RXNE, DISABLE); } }
|