Skip to content

STM32F3: Correct UART4 and UART5 defines when using DEVICE_SERIAL_ASYNCH #3121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F3/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ static void uart_irq(int id)
if (__HAL_UART_GET_IT_SOURCE(huart, UART_IT_RXNE) != RESET) {
irq_handler(serial_irq_ids[id], RxIrq);
volatile uint32_t tmpval = huart->Instance->RDR; // Clear RXNE flag
UNUSED(tmpval);
}
}
if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) != RESET) {
Expand Down Expand Up @@ -578,14 +579,14 @@ static IRQn_Type serial_get_irq_n(serial_t *obj)
irq_n = USART3_IRQn;
break;
#endif
#if defined(USART4_BASE)
#if defined(UART4_BASE)
case 3:
irq_n = USART4_IRQn;
irq_n = UART4_IRQn;
break;
#endif
#if defined(USART5_BASE)
#if defined(UART5_BASE)
case 4:
irq_n = USART5_IRQn;
irq_n = UART5_IRQn;
break;
#endif
default:
Expand Down Expand Up @@ -875,6 +876,7 @@ void serial_rx_abort_asynch(serial_t *obj)
// clear flags
__HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_PEF | UART_CLEAR_FEF | UART_CLEAR_OREF);
volatile uint32_t tmpval = huart->Instance->RDR; // Clear RXNE flag
UNUSED(tmpval);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


// reset states
huart->RxXferCount = 0;
Expand Down