Skip to content

Commit dc0b26d

Browse files
committed
Merge pull request #1014 from jurgis/1013-lpc1549-serial-attach-without-handler-not-disabling-irq
LPC1549 - Properly disable usart interrupt
2 parents c5c542c + 93af661 commit dc0b26d

File tree

1 file changed

+1
-1
lines changed
  • libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX

1 file changed

+1
-1
lines changed

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX/serial_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) {
261261
} else { // disable
262262
int all_disabled = 0;
263263
SerialIrq other_irq = (irq == RxIrq) ? (TxIrq) : (RxIrq);
264-
obj->uart->INTENSET &= ~(1 << ((irq == RxIrq) ? 0 : 2));
264+
obj->uart->INTENCLR |= (1 << ((irq == RxIrq) ? 0 : 2)); // disable the interrupt
265265
all_disabled = (obj->uart->INTENSET & (1 << ((other_irq == RxIrq) ? 0 : 2))) == 0;
266266
if (all_disabled)
267267
NVIC_DisableIRQ(irq_n);

0 commit comments

Comments
 (0)