Skip to content

Commit 83b7b6d

Browse files
Filip Jagodzinskimprse
authored andcommitted
LPC55S69: 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 8dc15ee commit 83b7b6d

File tree

1 file changed

+3
-3
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC

1 file changed

+3
-3
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2006-2013 ARM Limited
2+
* Copyright (c) 2006-2020 ARM Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -189,10 +189,10 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
189189
static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_not_empty, uint32_t index)
190190
{
191191
if (serial_irq_ids[index] != 0) {
192-
if (transmit_empty)
192+
if (transmit_empty && (uart_addrs[index]->FIFOINTENSET & kUSART_TxLevelInterruptEnable))
193193
irq_handler(serial_irq_ids[index], TxIrq);
194194

195-
if (receive_not_empty)
195+
if (receive_not_empty && (uart_addrs[index]->FIFOINTENSET & kUSART_RxLevelInterruptEnable))
196196
irq_handler(serial_irq_ids[index], RxIrq);
197197
}
198198
}

0 commit comments

Comments
 (0)