Skip to content

Commit 8e3ca20

Browse files
author
Filip Jagodzinski
committed
K82F: 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 3119d69 commit 8e3ca20

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/serial_api.c

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

154154
if (serial_irq_ids[index] != 0) {
155-
if (transmit_empty)
155+
if (transmit_empty && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_TxDataRegEmptyInterruptEnable))
156156
irq_handler(serial_irq_ids[index], TxIrq);
157157

158-
if (receive_full)
158+
if (receive_full && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_RxDataRegFullInterruptEnable))
159159
irq_handler(serial_irq_ids[index], RxIrq);
160160
}
161161
}

0 commit comments

Comments
 (0)