Skip to content

Commit cbcdfab

Browse files
committed
Fix IRQ enabled in serial_irq_set()
UART_IT_TC was enabled instead of UART_IT_TXE This was causing an issue because UART_IT_TXE (and not UART_IT_TC) was disabled by same function. Consequently if a transfer was ongoing when serial_irq_set() was called to disable IRQ, UART_IT_TC would still trigger (once). Side effect is maybe speed: I guess using UART_IT_TC prevented implementation of continuous transfer. This commit is focused on solving an issue observed with TARGET_STM32F4. It doesn't presume it should or shouldn't be done for other targets.
1 parent 6501de9 commit cbcdfab

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
748748
NVIC_EnableIRQ(irq_n);
749749
#endif
750750
} else { // TxIrq
751-
__HAL_UART_ENABLE_IT(handle, UART_IT_TC);
751+
__HAL_UART_ENABLE_IT(handle, UART_IT_TXE);
752752
NVIC_SetVector(irq_n, vector);
753753
NVIC_EnableIRQ(irq_n);
754754
#if DEVICE_SERIAL_ASYNCH_DMA

0 commit comments

Comments
 (0)