2017-07-19 03:50 AM
To clear the RXNE Flag of an USART, you can either read the RDR register or set the RXFRQ flag in de RQR register.
Which of these two methods will take up the least processing time?
void USART2_IRQHandler(void)
{
uint8_t c;
NVIC_ClearPendingIRQ(USART2_IRQn)
if(USART2->ISR&USART_ISR_RXNE) // data is received
{
c = USART2->RDR; // read RDR register
USART2->RQR |= USART_RQR_RXFRQ; // Send RDR flush request
}
}�?�?�?�?�?�?�?�?�?�?�?�?�?
#stm32f0 #usart