diff --git a/src/platforms/stm32/usbuart.c b/src/platforms/stm32/usbuart.c index 4775e1d..8c04db7 100644 --- a/src/platforms/stm32/usbuart.c +++ b/src/platforms/stm32/usbuart.c @@ -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); }