Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions arch/arm/src/common/stm32/stm32_exti_gpio_m0_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
xcpt_t handler;
int nshared;
int i;
int ret;

/* Select the interrupt handler for this EXTI pin */

Expand Down Expand Up @@ -274,6 +275,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,

if (i == nshared)
{
/* remove any leftover callback */
Comment thread
xiaoxiang781216 marked this conversation as resolved.

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}
}
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/common/stm32/stm32_exti_gpio_m3m4_v1v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
xcpt_t handler;
int nshared;
int i;
int ret;

/* Select the interrupt handler for this EXTI pin */

Expand Down Expand Up @@ -333,6 +334,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,

if (i == nshared)
{
/* remove any leftover callback */

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}
}
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/stm32f7/stm32_exti_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
xcpt_t handler;
int nshared;
int i;
int ret;

/* Select the interrupt handler for this EXTI pin */

Expand Down Expand Up @@ -340,6 +341,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,

if (i == nshared)
{
/* remove any leftover callback */

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}
}
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/stm32h7/stm32_exti_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
xcpt_t handler;
int nshared;
int i;
int ret;

/* Select the interrupt handler for this EXTI pin */

Expand Down Expand Up @@ -342,6 +343,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,

if (i == nshared)
{
/* remove any leftover callback */

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}
}
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/stm32l4/stm32l4_exti_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
xcpt_t handler;
int nshared;
int i;
int ret;

/* Select the interrupt handler for this EXTI pin */

Expand Down Expand Up @@ -336,6 +337,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,

if (i == nshared)
{
/* remove any leftover callback */

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}
}
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/stm32l5/stm32l5_exti_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
uint32_t pin = pinset & GPIO_PIN_MASK;
uint32_t exti = 1 << pin;
int irq = STM32_IRQ_EXTI0 + pin;
int ret;

g_gpio_handlers[pin].callback = func;
g_gpio_handlers[pin].arg = arg;
Expand All @@ -139,6 +140,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
}
else
{
/* remove any leftover callback */

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}

Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/stm32u5/stm32_exti_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
uint32_t pin = pinset & GPIO_PIN_MASK;
uint32_t exti = 1 << pin;
int irq = STM32_IRQ_EXTI0 + pin;
int ret;

g_gpio_handlers[pin].callback = func;
g_gpio_handlers[pin].arg = arg;
Expand All @@ -139,6 +140,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
}
else
{
/* remove any leftover callback */

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}

Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/stm32wb/stm32wb_exti_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
xcpt_t handler;
int nshared;
int i;
int ret;

/* Select the interrupt handler for this EXTI pin */

Expand Down Expand Up @@ -334,6 +335,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,

if (i == nshared)
{
/* remove any leftover callback */

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}
}
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/stm32wl5/stm32wl5_exti_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
xcpt_t handler;
int nshared;
int i;
int ret;

/* Select the interrupt handler for this EXTI pin */

Expand Down Expand Up @@ -336,6 +337,16 @@ int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,

if (i == nshared)
{
/* remove any leftover callback */

ret = irq_detach(irq);
if (ret < 0)
{
return ret;
}

/* disable the interrupt */

up_disable_irq(irq);
}
}
Expand Down
Loading