Skip to content

Commit 01e130b

Browse files
author
Filip Jagodzinski
committed
K24F: 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 f60850a commit 01e130b

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/serial_api.c

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

142142
if (serial_irq_ids[index] != 0) {
143-
if (transmit_empty)
143+
if (transmit_empty && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_TxDataRegEmptyInterruptEnable))
144144
irq_handler(serial_irq_ids[index], TxIrq);
145145

146-
if (receive_full)
146+
if (receive_full && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_RxDataRegFullInterruptEnable))
147147
irq_handler(serial_irq_ids[index], RxIrq);
148148
}
149149
}

0 commit comments

Comments
 (0)