mbed
Fork of mbed-dev by
Diff: targets/TARGET_STM/TARGET_STM32L0/serial_device.c
- Revision:
- 169:e3b6fe271b81
- Parent:
- 167:e84263d55307
- Child:
- 171:19eb464bc2be
diff -r 9672193075cf -r e3b6fe271b81 targets/TARGET_STM/TARGET_STM32L0/serial_device.c --- a/targets/TARGET_STM/TARGET_STM32L0/serial_device.c Thu Jul 06 15:42:05 2017 +0100 +++ b/targets/TARGET_STM/TARGET_STM32L0/serial_device.c Wed Jul 19 17:31:21 2017 +0100 @@ -202,19 +202,19 @@ if (serial_irq_ids[id] != 0) { if (__HAL_UART_GET_FLAG(huart, UART_FLAG_TC) != RESET) { - if (__HAL_UART_GET_IT_SOURCE(huart, UART_IT_TC) != RESET) { + if (__HAL_UART_GET_IT(huart, UART_IT_TC) != RESET) { irq_handler(serial_irq_ids[id], TxIrq); __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_TCF); } } if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RXNE) != RESET) { - if (__HAL_UART_GET_IT_SOURCE(huart, UART_IT_RXNE) != RESET) { + if (__HAL_UART_GET_IT(huart, UART_IT_RXNE) != RESET) { irq_handler(serial_irq_ids[id], RxIrq); volatile uint32_t tmpval = huart->Instance->RDR; // Clear RXNE flag } } if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) != RESET) { - if (__HAL_UART_GET_IT_SOURCE(huart, UART_IT_ORE) != RESET) { + if (__HAL_UART_GET_IT(huart, UART_IT_ORE) != RESET) { __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF); } } @@ -645,27 +645,27 @@ // Handle error events if (__HAL_UART_GET_FLAG(huart, UART_FLAG_PE) != RESET) { - if (__HAL_UART_GET_IT_SOURCE(huart, USART_IT_ERR) != RESET) { __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_PEF); + if (__HAL_UART_GET_IT(huart, USART_IT_ERR) != RESET) { return_event |= (SERIAL_EVENT_RX_PARITY_ERROR & obj_s->events); } } if (__HAL_UART_GET_FLAG(huart, UART_FLAG_FE) != RESET) { - if (__HAL_UART_GET_IT_SOURCE(huart, USART_IT_ERR) != RESET) { + if (__HAL_UART_GET_IT(huart, UART_IT_FE) != RESET) { __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_FEF); return_event |= (SERIAL_EVENT_RX_FRAMING_ERROR & obj_s->events); } } if (__HAL_UART_GET_FLAG(huart, UART_FLAG_NE) != RESET) { - if (__HAL_UART_GET_IT_SOURCE(huart, USART_IT_ERR) != RESET) { + if (__HAL_UART_GET_IT(huart, UART_IT_NE) != RESET) { __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_NEF); } } if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) != RESET) { - if (__HAL_UART_GET_IT_SOURCE(huart, USART_IT_ERR) != RESET) { + if (__HAL_UART_GET_IT(huart, UART_IT_ORE) != RESET) { __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF); return_event |= (SERIAL_EVENT_RX_OVERRUN_ERROR & obj_s->events); }