From 83b7b6d1426a6d2e195b1897856a1cba7be07754 Mon Sep 17 00:00:00 2001 From: Filip Jagodzinski Date: Thu, 30 Jan 2020 13:17:13 +0100 Subject: [PATCH 1/2] LPC55S69: Fix serial IRQ handling Check that the RX or TX interrupt is enabled before calling a registered handler with RxIrq or TxIrq arg. --- .../TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c index fe570da53ce..2bf9b003623 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * 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 static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_not_empty, uint32_t index) { if (serial_irq_ids[index] != 0) { - if (transmit_empty) + if (transmit_empty && (uart_addrs[index]->FIFOINTENSET & kUSART_TxLevelInterruptEnable)) irq_handler(serial_irq_ids[index], TxIrq); - if (receive_not_empty) + if (receive_not_empty && (uart_addrs[index]->FIFOINTENSET & kUSART_RxLevelInterruptEnable)) irq_handler(serial_irq_ids[index], RxIrq); } } From a0ff95bed586084cdbd693a3f71e902c7aafa7f2 Mon Sep 17 00:00:00 2001 From: Przemyslaw Stekiel Date: Fri, 7 Feb 2020 12:33:15 +0100 Subject: [PATCH 2/2] LPC55S69: Add restricted GPIO pins for FPGA testing --- .../TARGET_LPCXpresso/PeripheralPins.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_LPCXpresso/PeripheralPins.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_LPCXpresso/PeripheralPins.c index d7b457c41a9..b6364d7ccf2 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_LPCXpresso/PeripheralPins.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_LPCXpresso/PeripheralPins.c @@ -16,3 +16,24 @@ #include "PeripheralPins.h" #include "PeripheralPinMaps.h" + +// List of GPIOs with limited functionality +const PinList *pinmap_gpio_restricted_pins() +{ + static const PinName pins[] = { + A4, // fixed pull-up (for I2C) + A5, // fixed pull-up (for I2C) + D5, // fixed pull-up (for LED) + D3, // fixed pull-up (for LED) + D4, // fixed pull-up (for LED) + D7, // fixed pull-up + D15, // fixed pull-up (for I2C) + D14 // fixed pull-up (for I2C) + }; + + static const PinList pin_list = { + sizeof(pins) / sizeof(pins[0]), + pins + }; + return &pin_list; +}