TEST
Dependencies: max32630fthr Adafruit_FeatherOLED USBDevice
mbed_os_patches/buttoninterrupt.patch
- Committer:
- wwwarunraj
- Date:
- 2020-04-19
- Revision:
- 4:291477e8690d
- Parent:
- 1:f60eafbf009a
File content as of revision 4:291477e8690d:
diff --git a/targets/TARGET_Maxim/TARGET_MAX32630/gpio_irq_api.c b/targets/TARGET_Maxim/TARGET_MAX32630/gpio_irq_api.c index 8a9e7bb42..e5fcb4b6f 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32630/gpio_irq_api.c +++ b/targets/TARGET_Maxim/TARGET_MAX32630/gpio_irq_api.c @@ -118,7 +118,12 @@ int gpio_irq_init(gpio_irq_t *obj, PinName name, gpio_irq_handler handler, uint3 /* enable the requested interrupt */ MXC_GPIO->inten[port] |= (1 << pin); - NVIC_EnableIRQ((IRQn_Type)((uint32_t)GPIO_P0_IRQn + port)); + if (port >= 7) { + NVIC_EnableIRQ((IRQn_Type)((uint32_t)GPIO_P7_IRQn + (port - 7))); + } else { + NVIC_EnableIRQ((IRQn_Type)((uint32_t)GPIO_P0_IRQn + port)); + } + return 0; }