Skip to content

Commit 1fc4fab

Browse files
pennamfacchinm
authored andcommitted
gpio_irq_enable event fix
1 parent 94484be commit 1fc4fab

File tree

1 file changed

+3
-3
lines changed
  • targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/interface

1 file changed

+3
-3
lines changed

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/interface/cyhal_gpio.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ void cyhal_gpio_irq_enable(cyhal_gpio_t pin, cyhal_gpio_irq_event_t event, bool
2626
{
2727
oob_event = event;
2828
if (enable) {
29-
if (CYHAL_GPIO_IRQ_RISE) {
29+
if (event == CYHAL_GPIO_IRQ_RISE) {
3030
oob_irq->rise(cb);
3131
}
32-
if (CYHAL_GPIO_IRQ_FALL) {
32+
if (event == CYHAL_GPIO_IRQ_FALL) {
3333
oob_irq->fall(cb);
3434
}
3535
} else if (oob_irq != NULL) {
@@ -59,4 +59,4 @@ void cyhal_gpio_write(cyhal_gpio_t pin, bool value)
5959
{
6060
/*printf("Port %s %s %d\n",(value)?"High":"low",PinConfig[pin].portname, PinConfig[pin].pinnumber);*/
6161
HAL_GPIO_WritePin(PinConfig[pin].port, PinConfig[pin].config.Pin, (value)?GPIO_PIN_SET:GPIO_PIN_RESET);
62-
}
62+
}

0 commit comments

Comments
 (0)