stm32/usbuart: Clear USART_ICR if provided.

Otherwise endless interrupts happened.
This commit is contained in:
Uwe Bonnes 2021-05-11 11:21:27 +02:00 committed by UweBonnes
parent 90534b3cf6
commit 7f1a560288
1 changed files with 8 additions and 1 deletions

View File

@ -399,8 +399,15 @@ void USBUSART_ISR(void)
usart_recv(USBUSART);
/* If line is now idle, then transmit a packet */
if (isIdle)
if (isIdle) {
#if defined(USART_ICR)
USART_ICR(USBUSART) = USART_ICR_IDLECF;
#else
/* On the older uarts, the sequence "read flags", "read DR"
* as above cleared the flags */
#endif
usbuart_run();
}
nvic_enable_irq(USBUSART_DMA_RX_IRQ);
}