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.
This commit is contained in:
parent
89058172f1
commit
d5e04a8c43
@ -158,7 +158,5 @@ int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
|
|||||||
func ? 0 : EXTI_PVD_LINE,
|
func ? 0 : EXTI_PVD_LINE,
|
||||||
func ? EXTI_PVD_LINE : 0);
|
func ? EXTI_PVD_LINE : 0);
|
||||||
|
|
||||||
/* Return the old IRQ handler */
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,5 @@ int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
|
|||||||
func ? 0 : EXTI_PVD_LINE,
|
func ? 0 : EXTI_PVD_LINE,
|
||||||
func ? EXTI_PVD_LINE : 0);
|
func ? EXTI_PVD_LINE : 0);
|
||||||
|
|
||||||
/* Return the old IRQ handler */
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@ -127,15 +127,14 @@ xcpt_t stm32l4_exti_alarm(bool risingedge, bool fallingedge, bool event,
|
|||||||
* - arg: Argument passed to the interrupt callback
|
* - arg: Argument passed to the interrupt callback
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* The previous value of the interrupt handler function pointer. This
|
* Zero (OK) returned on success; a negated errno value is returned on
|
||||||
* value may, for example, be used to restore the previous handler when
|
* failure.
|
||||||
* multiple handlers are used.
|
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_STM32L4_COMP
|
#ifdef CONFIG_STM32L4_COMP
|
||||||
xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
|
int stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
|
||||||
bool event, xcpt_t func, void *arg);
|
bool event, xcpt_t func, void *arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
@ -129,16 +129,14 @@ static int stm32l4_exti_comp_isr(int irq, void *context)
|
|||||||
* - arg: Argument passed to the interrupt callback
|
* - arg: Argument passed to the interrupt callback
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* The previous value of the interrupt handler function pointer. This
|
* Zero (OK) returned on success; a negated errno value is returned on
|
||||||
* value may, for example, be used to restore the previous handler when
|
* failure.
|
||||||
* multiple handlers are used.
|
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
|
int stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge,
|
||||||
bool event, xcpt_t func, void *arg)
|
bool event, xcpt_t func, void *arg)
|
||||||
{
|
{
|
||||||
xcpt_t oldhandler;
|
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
uint32_t ln = g_comp_lines[cmp];
|
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)
|
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);
|
up_enable_irq(STM32L4_IRQ_COMP);
|
||||||
}
|
}
|
||||||
else
|
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. */
|
/* 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].callback = func;
|
||||||
g_comp_handlers[cmp].arg = arg;
|
g_comp_handlers[cmp].arg = arg;
|
||||||
|
|
||||||
/* Leave the critical section */
|
/* Leave the critical section */
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
return OK;
|
||||||
/* Return the old IRQ handler */
|
|
||||||
|
|
||||||
return oldhandler;
|
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,5 @@ int stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event,
|
|||||||
func ? 0 : EXTI1_PVD_LINE,
|
func ? 0 : EXTI1_PVD_LINE,
|
||||||
func ? EXTI1_PVD_LINE : 0);
|
func ? EXTI1_PVD_LINE : 0);
|
||||||
|
|
||||||
/* Return the old IRQ handler */
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user