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

STM32/F7/L4: EXOT PVD function no longer returns the xcpt_t oldhandler. There...

STM32/F7/L4: EXOT PVD function no longer returns the xcpt_t oldhandler.  There value is useless and dangerous after the recent changes to interrupt argument passing.
parent f5f9d82d
No related branches found
No related tags found
No related merge requests found
/****************************************************************************
* arch/arm/src/stm32/stm32_exti_pwr.c
*
* Copyright (C) 2009, 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2009, 2011-2012, 2015, 2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2015 Haltian Ltd. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
* Dmitry Nikolaev <dmitry.nikolaev@haltian.com>
......@@ -115,20 +115,16 @@ static int stm32_exti_pvd_isr(int irq, void *context, FAR void *arg)
* - 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 stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg)
int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg)
{
xcpt_t oldhandler;
/* Get the previous GPIO IRQ handler; Save the new IRQ handler. */
oldhandler = g_pvd_callback;
g_pvd_callback = func;
g_callback_arg = arg;
......@@ -164,5 +160,5 @@ xcpt_t stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
/* Return the old IRQ handler */
return oldhandler;
return OK;
}
......@@ -60,13 +60,12 @@
* - 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 stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg);
int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg);
#endif /* STM32_EXTI_PWR_H_ */
......@@ -123,20 +123,16 @@ static int stm32_exti_pvd_isr(int irq, void *context, void *arg)
* - func: when non-NULL, generate interrupt
*
* 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 stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg)
int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg);
{
xcpt_t oldhandler;
/* Get the previous GPIO IRQ handler; Save the new IRQ handler. */
oldhandler = g_pvd_callback;
g_pvd_callback = func;
g_callback_arg = arg;
......@@ -172,5 +168,5 @@ xcpt_t stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
/* Return the old IRQ handler */
return oldhandler;
return OK;
}
......@@ -61,13 +61,12 @@
* - 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 stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg);
int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg);
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_EXTI_PWR_H */
......@@ -114,20 +114,16 @@ static int stm32l4_exti_pvd_isr(int irq, void *context, FAR void *arg)
* - func: when non-NULL, generate interrupt
*
* 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_pvd(bool risingedge, bool fallingedge, bool event,
int stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg)
{
xcpt_t oldhandler;
/* Get the previous GPIO IRQ handler; Save the new IRQ handler. */
oldhandler = g_pvd_callback;
g_pvd_callback = func;
g_callback_arg = arg;
......@@ -163,5 +159,5 @@ xcpt_t stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event,
/* Return the old IRQ handler */
return oldhandler;
return OK;
}
......@@ -60,13 +60,12 @@
* - 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_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg);
int stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg);
#endif /* STM32L4_EXTI_PWR_H_ */
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