Skip to content

Commit 68b0345

Browse files
committed
avoid getting stuck in serial IRQ if ORE is set without RXNE - issue #1605
1 parent f178fc4 commit 68b0345

File tree

1 file changed

+3
-0
lines changed
  • libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4

1 file changed

+3
-0
lines changed

libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/serial_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ static void uart_irq(int id)
451451
irq_handler(serial_irq_ids[id], RxIrq);
452452
__HAL_UART_CLEAR_FLAG(handle, UART_FLAG_RXNE);
453453
}
454+
if (__HAL_UART_GET_FLAG(handle, UART_FLAG_ORE) != RESET) {
455+
uint8_t c = handle->Instance->DR;
456+
}
454457
}
455458
}
456459

0 commit comments

Comments
 (0)