Skip to content

Commit

Permalink
Merge pull request #2128 from LMESTM/fix_F4_serial_it_issue2119
Browse files Browse the repository at this point in the history
[STM32] Serial interrupt TC vs. TXE
  • Loading branch information
0xc0170 authored Jul 15, 2016
2 parents 1201f4a + 9c33f70 commit 38ae4f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hal/targets/hal/TARGET_STM/TARGET_STM32F4/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
NVIC_EnableIRQ(irq_n);
#endif
} else { // TxIrq
__HAL_UART_ENABLE_IT(handle, UART_IT_TXE);
__HAL_UART_ENABLE_IT(handle, UART_IT_TC);
NVIC_SetVector(irq_n, vector);
NVIC_EnableIRQ(irq_n);
#if DEVICE_SERIAL_ASYNCH_DMA
Expand All @@ -788,7 +788,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
// Check if TxIrq is disabled too
if ((handle->Instance->CR1 & USART_CR1_TXEIE) == 0) all_disabled = 1;
} else { // TxIrq
__HAL_UART_DISABLE_IT(handle, UART_IT_TXE);
__HAL_UART_DISABLE_IT(handle, UART_IT_TC);
// Check if RxIrq is disabled too
if ((handle->Instance->CR1 & USART_CR1_RXNEIE) == 0) all_disabled = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion hal/targets/hal/TARGET_STM/TARGET_STM32F7/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
// Check if TxIrq is disabled too
if ((UartHandle.Instance->CR1 & USART_CR1_TXEIE) == 0) all_disabled = 1;
} else { // TxIrq
__HAL_UART_DISABLE_IT(&UartHandle, UART_IT_TXE);
__HAL_UART_DISABLE_IT(&UartHandle, UART_IT_TC);
// Check if RxIrq is disabled too
if ((UartHandle.Instance->CR1 & USART_CR1_RXNEIE) == 0) all_disabled = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion hal/targets/hal/TARGET_STM/TARGET_STM32L1/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
// Check if TxIrq is disabled too
if ((UartHandle.Instance->CR1 & USART_CR1_TXEIE) == 0) all_disabled = 1;
} else { // TxIrq
__HAL_UART_DISABLE_IT(&UartHandle, UART_IT_TXE);
__HAL_UART_DISABLE_IT(&UartHandle, UART_IT_TC);
// Check if RxIrq is disabled too
if ((UartHandle.Instance->CR1 & USART_CR1_RXNEIE) == 0) all_disabled = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion hal/targets/hal/TARGET_STM/TARGET_STM32L4/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
// Check if TxIrq is disabled too
if ((UartHandle.Instance->CR1 & USART_CR1_TXEIE) == 0) all_disabled = 1;
} else { // TxIrq
__HAL_UART_DISABLE_IT(&UartHandle, UART_IT_TXE);
__HAL_UART_DISABLE_IT(&UartHandle, UART_IT_TC);
// Check if RxIrq is disabled too
if ((UartHandle.Instance->CR1 & USART_CR1_RXNEIE) == 0) all_disabled = 1;
}
Expand Down

0 comments on commit 38ae4f9

Please sign in to comment.