Skip to content

Commit 7ff1cf5

Browse files
committed
STM32F0 uart irq: test IT flags for usart3/4
1 parent 18659ab commit 7ff1cf5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

targets/TARGET_STM/TARGET_STM32F0/serial_device.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,14 @@ static void uart3_8_irq(void)
122122
#endif
123123
#else // TARGET_STM32F070RB, TARGET_STM32F072RB
124124
#if defined(USART3_BASE)
125-
uart_irq(2);
125+
if (USART3->ISR & (UART_FLAG_TXE | UART_FLAG_RXNE | UART_FLAG_ORE)) {
126+
uart_irq(2);
127+
}
126128
#endif
127129
#if defined(USART4_BASE)
128-
uart_irq(3);
130+
if (USART4->ISR & (UART_FLAG_TXE | UART_FLAG_RXNE | UART_FLAG_ORE)) {
131+
uart_irq(3);
132+
}
129133
#endif
130134
#endif
131135
}

0 commit comments

Comments
 (0)