diff --git a/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/interface/cyhal_gpio.cpp b/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/interface/cyhal_gpio.cpp index 73acad0a232..691c9f2d84a 100644 --- a/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/interface/cyhal_gpio.cpp +++ b/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/interface/cyhal_gpio.cpp @@ -26,10 +26,10 @@ void cyhal_gpio_irq_enable(cyhal_gpio_t pin, cyhal_gpio_irq_event_t event, bool { oob_event = event; if (enable) { - if (CYHAL_GPIO_IRQ_RISE) { + if (event == CYHAL_GPIO_IRQ_RISE) { oob_irq->rise(cb); } - if (CYHAL_GPIO_IRQ_FALL) { + if (event == CYHAL_GPIO_IRQ_FALL) { oob_irq->fall(cb); } } else if (oob_irq != NULL) { @@ -59,4 +59,4 @@ void cyhal_gpio_write(cyhal_gpio_t pin, bool value) { /*printf("Port %s %s %d\n",(value)?"High":"low",PinConfig[pin].portname, PinConfig[pin].pinnumber);*/ HAL_GPIO_WritePin(PinConfig[pin].port, PinConfig[pin].config.Pin, (value)?GPIO_PIN_SET:GPIO_PIN_RESET); -} \ No newline at end of file +}