K66F: Fix serial IRQ handling

Check that the RX or TX interrupt is enabled before calling
a registered handler with RxIrq or TxIrq arg.
pull/10774/head
Filip Jagodzinski 2019-06-07 16:41:36 +02:00
parent 68269672c4
commit 9efaabe404
1 changed files with 2 additions and 2 deletions

View File

@ -127,10 +127,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
}
if (serial_irq_ids[index] != 0) {
if (transmit_empty)
if (transmit_empty && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_TxDataRegEmptyInterruptEnable))
irq_handler(serial_irq_ids[index], TxIrq);
if (receive_full)
if (receive_full && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_RxDataRegFullInterruptEnable))
irq_handler(serial_irq_ids[index], RxIrq);
}
}