Skip to content
Snippets Groups Projects
Commit d5e04a8c authored by Gregory Nutt's avatar Gregory Nutt
Browse files

STM3 L4: EXTI COMP function no longer returns the xcpt_t oldhandler. There...

STM3 L4: EXTI COMP function no longer returns the xcpt_t oldhandler.  There value is useless and dangerous after the recent changes to interrupt argument passing.
parent 89058172
No related branches found
No related tags found
No related merge requests found
......@@ -158,7 +158,5 @@ int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
func ? 0 : EXTI_PVD_LINE,
func ? EXTI_PVD_LINE : 0);
/* Return the old IRQ handler */
return OK;
}
......@@ -166,7 +166,5 @@ int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
func ? 0 : EXTI_PVD_LINE,
func ? EXTI_PVD_LINE : 0);
/* Return the old IRQ handler */
return OK;
}
......@@ -127,15 +127,14 @@ xcpt_t stm32l4_exti_alarm(bool risingedge, bool fallingedge, bool event,
* - arg: Argument passed to the interrupt callback
*
* Returns:
* The previous value of the interrupt handler function pointer. This
* value may, for example, be used to restore the previous handler when
* multiple handlers are used.
* Zero (OK) returned on success; a negated errno value is returned on
* failure.
*
****************************************************************************/
#ifdef CONFIG_STM32L4_COMP
xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
bool event, xcpt_t func, void *arg);
int stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
bool event, xcpt_t func, void *arg);
#endif
#undef EXTERN
......
......@@ -129,16 +129,14 @@ static int stm32l4_exti_comp_isr(int irq, void *context)
* - arg: Argument passed to the interrupt callback
*
* Returns:
* The previous value of the interrupt handler function pointer. This
* value may, for example, be used to restore the previous handler when
* multiple handlers are used.
* Zero (OK) returned on success; a negated errno value is returned on
* failure.
*
****************************************************************************/
xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
bool event, xcpt_t func, void *arg)
int stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
bool event, xcpt_t func, void *arg)
{
xcpt_t oldhandler;
irqstate_t flags;
uint32_t ln = g_comp_lines[cmp];
......@@ -152,7 +150,7 @@ xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
if (func != NULL)
{
irq_attach(STM32L4_IRQ_COMP, stm32l4_exti_comp_isr);
irq_attach(STM32L4_IRQ_COMP, stm32l4_exti_comp_isr, NULL);
up_enable_irq(STM32L4_IRQ_COMP);
}
else
......@@ -172,15 +170,11 @@ xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
/* Get the previous IRQ handler and save the new IRQ handler. */
oldhandler = g_comp_handlers[cmp].callback;
g_comp_handlers[cmp].callback = func;
g_comp_handlers[cmp].arg = arg;
/* Leave the critical section */
leave_critical_section(flags);
/* Return the old IRQ handler */
return oldhandler;
return OK;
}
......@@ -157,7 +157,5 @@ int stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event,
func ? 0 : EXTI1_PVD_LINE,
func ? EXTI1_PVD_LINE : 0);
/* Return the old IRQ handler */
return OK;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment