Skip to content

Commit

Permalink
Merge pull request #3121 from monkiineko/master
Browse files Browse the repository at this point in the history
STM32F3: Correct UART4 and UART5 defines when using DEVICE_SERIAL_ASYNCH
  • Loading branch information
0xc0170 authored Oct 27, 2016
2 parents b826d1b + 97eaed7 commit da377aa
Showing 1 changed file with 6 additions and 4 deletions.
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);

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

0 comments on commit da377aa

Please sign in to comment.