Skip to content

Commit 9efaabe

Browse files
author
Filip Jagodzinski
committed
K66F: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling a registered handler with RxIrq or TxIrq arg.
1 parent 6826967 commit 9efaabe

File tree

1 file changed

+2
-2
lines changed
  • targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F

1 file changed

+2
-2
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
127127
}
128128

129129
if (serial_irq_ids[index] != 0) {
130-
if (transmit_empty)
130+
if (transmit_empty && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_TxDataRegEmptyInterruptEnable))
131131
irq_handler(serial_irq_ids[index], TxIrq);
132132

133-
if (receive_full)
133+
if (receive_full && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_RxDataRegFullInterruptEnable))
134134
irq_handler(serial_irq_ids[index], RxIrq);
135135
}
136136
}

0 commit comments

Comments
 (0)