diff --git a/arch/cpu/cc2538/dev/gpio-hal-arch.c b/arch/cpu/cc2538/dev/gpio-hal-arch.c index dd8e5c513..bd2dfb92d 100644 --- a/arch/cpu/cc2538/dev/gpio-hal-arch.c +++ b/arch/cpu/cc2538/dev/gpio-hal-arch.c @@ -87,6 +87,7 @@ gpio_hal_arch_pin_cfg_set(gpio_hal_pin_t pin, gpio_hal_pin_cfg_t cfg) GPIO_DISABLE_INTERRUPT(port_base, pin_mask); } else if(tmp == GPIO_HAL_PIN_CFG_INT_ENABLE) { GPIO_ENABLE_INTERRUPT(port_base, pin_mask); + NVIC_EnableIRQ(port); } GPIO_SOFTWARE_CONTROL(port_base, pin_mask); diff --git a/arch/cpu/cc2538/dev/gpio-hal-arch.h b/arch/cpu/cc2538/dev/gpio-hal-arch.h index 78842634a..0b282c738 100644 --- a/arch/cpu/cc2538/dev/gpio-hal-arch.h +++ b/arch/cpu/cc2538/dev/gpio-hal-arch.h @@ -55,8 +55,10 @@ #define PIN_TO_PORT(pin) (pin >> 3) #define PIN_TO_PORT_BASE(pin) GPIO_PORT_TO_BASE(PIN_TO_PORT(pin)) /*---------------------------------------------------------------------------*/ -#define gpio_hal_arch_interrupt_enable(p) \ - GPIO_ENABLE_INTERRUPT(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8)) +#define gpio_hal_arch_interrupt_enable(p) do { \ + GPIO_ENABLE_INTERRUPT(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8)); \ + NVIC_EnableIRQ(PIN_TO_PORT(p)); \ +} while(0); #define gpio_hal_arch_interrupt_disable(p) \ GPIO_DISABLE_INTERRUPT(PIN_TO_PORT_BASE(p), GPIO_PIN_MASK((p) % 8))