diff --git a/arch/arm/src/stm32/stm32_exti.h b/arch/arm/src/stm32/stm32_exti.h index 6d4ab88337..9ac20798df 100644 --- a/arch/arm/src/stm32/stm32_exti.h +++ b/arch/arm/src/stm32/stm32_exti.h @@ -72,22 +72,21 @@ extern "C" * Description: * Sets/clears GPIO based event and interrupt triggers. * - * Parameters: + * Input Parameters: * - pinset: gpio pin configuration * - rising/falling edge: enables * - event: generate event when set * - func: when non-NULL, generate interrupt * - 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. + * Returned Value: + * Zero (OK) on success; a negated errno value on failure indicating the + * nature of the failure. * ************************************************************************************/ -xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, - bool event, xcpt_t func, void *arg); +int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg); /************************************************************************************ * Name: stm32_exti_alarm @@ -95,13 +94,13 @@ xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, * Description: * Sets/clears EXTI alarm interrupt. * - * Parameters: + * Input Parameters: * - rising/falling edge: enables interrupt on rising/falling edges * - event: generate event when set * - func: when non-NULL, generate interrupt * - arg: Argument passed to the interrupt callback * - * Returns: + * Returned Value: * Zero (OK) on success; a negated errno value on failure indicating the * nature of the failure. * diff --git a/arch/arm/src/stm32/stm32_exti_gpio.c b/arch/arm/src/stm32/stm32_exti_gpio.c index 5945c35e5c..663c0416b8 100644 --- a/arch/arm/src/stm32/stm32_exti_gpio.c +++ b/arch/arm/src/stm32/stm32_exti_gpio.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32/stm32_exti_gpio.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) 2011 Uros Platise. All rights reserved. * Author: Gregory Nutt * Uros Platise @@ -250,7 +250,7 @@ static int stm32_exti1510_isr(int irq, void *context, void *arg) * Description: * Sets/clears GPIO based event and interrupt triggers. * - * Parameters: + * Input Parameters: * - pinset: GPIO pin configuration * - risingedge: Enables interrupt on rising edges * - fallingedge: Enables interrupt on falling edges @@ -258,22 +258,20 @@ static int stm32_exti1510_isr(int irq, void *context, void *arg) * - func: When non-NULL, generate interrupt * - 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. + * Returned Value: + * Zero (OK) on success; a negated errno value on failure indicating the + * nature of the failure. * ****************************************************************************/ -xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, - bool event, xcpt_t func, void *arg) +int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg) { FAR struct gpio_callback_s *shared_cbs; uint32_t pin = pinset & GPIO_PIN_MASK; uint32_t exti = STM32_EXTI_BIT(pin); int irq; xcpt_t handler; - xcpt_t oldhandler = NULL; int nshared; int i; @@ -324,7 +322,6 @@ xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, /* Get the previous GPIO IRQ handler; Save the new IRQ handler. */ - oldhandler = g_gpio_callbacks[pin].callback; g_gpio_callbacks[pin].callback = func; g_gpio_callbacks[pin].arg = arg; @@ -384,7 +381,5 @@ xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, func ? 0 : exti, func ? exti : 0); - /* Return the old IRQ handler */ - - return oldhandler; + return OK; } diff --git a/arch/arm/src/stm32/stm32_gpio.h b/arch/arm/src/stm32/stm32_gpio.h index 06e09efc2b..0385d1e951 100644 --- a/arch/arm/src/stm32/stm32_gpio.h +++ b/arch/arm/src/stm32/stm32_gpio.h @@ -432,7 +432,7 @@ EXTERN const uint32_t g_gpiobase[STM32_NGPIO_PORTS]; * function, it must be unconfigured with stm32_unconfiggpio() with * the same cfgset first before it can be set to non-alternative function. * - * Returns: + * Returned Value: * OK on success * ERROR on invalid port, or when pin is locked as ALT function. * @@ -453,7 +453,7 @@ int stm32_configgpio(uint32_t cfgset); * operate in PWM mode could produce excessive on-board currents and trigger * over-current/alarm function. * - * Returns: + * Returned Value: * OK on success * ERROR on invalid port * @@ -487,22 +487,21 @@ bool stm32_gpioread(uint32_t pinset); * Description: * Sets/clears GPIO based event and interrupt triggers. * - * Parameters: + * Input Parameters: * - pinset: gpio pin configuration * - rising/falling edge: enables * - event: generate event when set * - func: when non-NULL, generate interrupt * - 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. + * Returned Value: + * Zero (OK) on success; a negated errno value on failure indicating the + * nature of the failure. * ************************************************************************************/ -xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, - bool event, xcpt_t func, void *arg); +int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg); /************************************************************************************ * Function: stm32_dumpgpio diff --git a/arch/arm/src/stm32/stm32_sdio.c b/arch/arm/src/stm32/stm32_sdio.c index 5b7f92887c..01d533ba70 100644 --- a/arch/arm/src/stm32/stm32_sdio.c +++ b/arch/arm/src/stm32/stm32_sdio.c @@ -668,16 +668,16 @@ static void stm32_configwaitints(struct stm32_dev_s *priv, uint32_t waitmask, /* Arm the SDIO_D Ready and install Isr */ - stm32_gpiosetevent(pinset, true, false, false, - stm32_rdyinterrupt, priv); + (void)stm32_gpiosetevent(pinset, true, false, false, + stm32_rdyinterrupt, priv); } /* Disarm SDIO_D ready */ if ((wkupevent & SDIOWAIT_WRCOMPLETE) != 0) { - stm32_gpiosetevent(GPIO_SDIO_D0, false, false, false, - NULL, NULL); + (void)stm32_gpiosetevent(GPIO_SDIO_D0, false, false, false, + NULL, NULL); stm32_configgpio(GPIO_SDIO_D0); } #endif diff --git a/arch/arm/src/stm32f7/stm32_exti.h b/arch/arm/src/stm32f7/stm32_exti.h index f8c33f3f16..f9b1f2eaa0 100644 --- a/arch/arm/src/stm32f7/stm32_exti.h +++ b/arch/arm/src/stm32f7/stm32_exti.h @@ -72,7 +72,7 @@ extern "C" * Description: * Sets/clears GPIO based event and interrupt triggers. * - * Parameters: + * Input Parameters: * - pinset: GPIO pin configuration * - risingedge: Enables interrupt on rising edges * - fallingedge: Enables interrupt on falling edges @@ -80,15 +80,14 @@ extern "C" * - func: When non-NULL, generate interrupt * - 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. + * Returned Value: + * Zero (OK) on success; a negated errno value on failure indicating the + * nature of the failure. * - ****************************************************************************/ + ************************************************************************************/ -xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, - bool event, xcpt_t func, void *arg); +int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg); /**************************************************************************** * Name: stm32_exti_alarm @@ -96,14 +95,14 @@ xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, * Description: * Sets/clears EXTI alarm interrupt. * - * Parameters: + * Input Parameters: * - risingedge: Enables interrupt on rising edges * - fallingedge: Enables interrupt on falling edges * - event: Generate event when set * - func: When non-NULL, generate interrupt * - arg: Argument passed to the interrupt callback * - * Returns: + * Returned Value: * Zero (OK) on success; a negated errno value on failure indicating the * nature of the failure. * diff --git a/arch/arm/src/stm32f7/stm32_exti_gpio.c b/arch/arm/src/stm32f7/stm32_exti_gpio.c index 22efc0bf41..e388054515 100644 --- a/arch/arm/src/stm32f7/stm32_exti_gpio.c +++ b/arch/arm/src/stm32f7/stm32_exti_gpio.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32f7/stm32_exti_gpio.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based on EXTI GPIO logic from the Cortex-M3/4 which includes contributions @@ -262,7 +262,7 @@ static int stm32_exti1510_isr(int irq, void *context, void *arg) * Description: * Sets/clears GPIO based event and interrupt triggers. * - * Parameters: + * Input Parameters: * - pinset: GPIO pin configuration * - risingedge: Enables interrupt on rising edges * - fallingedge: Enables interrupt on falling edges @@ -270,22 +270,20 @@ static int stm32_exti1510_isr(int irq, void *context, void *arg) * - func: When non-NULL, generate interrupt * - 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. + * Returned Value: + * Zero (OK) on success; a negated errno value on failure indicating the + * nature of the failure. * ****************************************************************************/ -xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, - bool event, xcpt_t func, void *arg) +int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg) { struct gpio_callback_s *shared_cbs; uint32_t pin = pinset & GPIO_PIN_MASK; uint32_t exti = STM32_EXTI_BIT(pin); int irq; xcpt_t handler; - xcpt_t oldhandler = NULL; int nshared; int i; @@ -336,7 +334,6 @@ xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, /* Get the previous GPIO IRQ handler; Save the new IRQ handler. */ - oldhandler = g_gpio_callbacks[pin].callback; g_gpio_callbacks[pin].callback = func; g_gpio_callbacks[pin].arg = arg; @@ -396,9 +393,7 @@ xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, func ? 0 : exti, func ? exti : 0); - /* Return the old IRQ handler */ - - return oldhandler; + return OK; } #endif /* CONFIG_STM32F7_STM32F74XX || CONFIG_STM32F7_STM32F75XX */ diff --git a/arch/arm/src/stm32f7/stm32_gpio.h b/arch/arm/src/stm32f7/stm32_gpio.h index 70bb15897a..35b7fc39d2 100644 --- a/arch/arm/src/stm32f7/stm32_gpio.h +++ b/arch/arm/src/stm32f7/stm32_gpio.h @@ -266,7 +266,7 @@ EXTERN const uint32_t g_gpiobase[STM32F7_NGPIO]; * function, it must be unconfigured with stm32_unconfiggpio() with * the same cfgset first before it can be set to non-alternative function. * - * Returns: + * Returned Value: * OK on success * ERROR on invalid port, or when pin is locked as ALT function. * @@ -287,7 +287,7 @@ int stm32_configgpio(uint32_t cfgset); * operate in PWM mode could produce excessive on-board currents and trigger * over-current/alarm function. * - * Returns: + * Returned Value: * OK on success * ERROR on invalid port * @@ -321,7 +321,7 @@ bool stm32_gpioread(uint32_t pinset); * Description: * Sets/clears GPIO based event and interrupt triggers. * - * Parameters: + * Input Parameters: * - pinset: GPIO pin configuration * - risingedge: Enables interrupt on rising edges * - fallingedge: Enables interrupt on falling edges @@ -329,15 +329,14 @@ bool stm32_gpioread(uint32_t pinset); * - func: When non-NULL, generate interrupt * - 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. + * Returned Value: + * Zero (OK) on success; a negated errno value on failure indicating the + * nature of the failure. * - ****************************************************************************/ + ************************************************************************************/ -xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, - bool event, xcpt_t func, void *arg); +int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg); /************************************************************************************ * Function: stm32_dumpgpio diff --git a/arch/arm/src/stm32f7/stm32_sdmmc.c b/arch/arm/src/stm32f7/stm32_sdmmc.c index df02d4fb0e..fee9b7600f 100644 --- a/arch/arm/src/stm32f7/stm32_sdmmc.c +++ b/arch/arm/src/stm32f7/stm32_sdmmc.c @@ -846,16 +846,16 @@ static void stm32_configwaitints(struct stm32_dev_s *priv, uint32_t waitmask, /* Arm the SDMMC_D Ready and install Isr */ - stm32_gpiosetevent(pinset, true, false, false, - priv->wrchandler, priv); + (void)stm32_gpiosetevent(pinset, true, false, false, + priv->wrchandler, priv); } /* Disarm SDMMC_D ready */ if ((wkupevent & SDIOWAIT_WRCOMPLETE) != 0) { - stm32_gpiosetevent(priv->d0_gpio, false, false, false, - NULL, NULL); + (void)stm32_gpiosetevent(priv->d0_gpio, false, false, false, + NULL, NULL); stm32_configgpio(priv->d0_gpio); } #endif diff --git a/configs/cloudctrl/src/stm32_buttons.c b/configs/cloudctrl/src/stm32_buttons.c index 35e250e4bc..b62dbeb719 100644 --- a/configs/cloudctrl/src/stm32_buttons.c +++ b/configs/cloudctrl/src/stm32_buttons.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -159,18 +160,17 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, + arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/fire-stm32v2/src/stm32_buttons.c b/configs/fire-stm32v2/src/stm32_buttons.c index b0a3c76f43..d2dd07cd8e 100644 --- a/configs/fire-stm32v2/src/stm32_buttons.c +++ b/configs/fire-stm32v2/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -135,8 +136,8 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler; uint16_t gpio; + int ret; if (id == BUTTON_KEY1) { @@ -148,13 +149,10 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) } else { - return NULL; + return -EINVAL; } - oldhandler = stm32_gpiosetevent(gpio, true, true, true, irqhandler, arg); - - UNUSED(oldhandler); - return OK; + return stm32_gpiosetevent(gpio, true, true, true, irqhandler, arg); } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/hymini-stm32v/src/stm32_buttons.c b/configs/hymini-stm32v/src/stm32_buttons.c index a3d36b3ea6..d92be06ab9 100644 --- a/configs/hymini-stm32v/src/stm32_buttons.c +++ b/configs/hymini-stm32v/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -134,8 +135,8 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; uint32_t pinset = GPIO_BTN_KEYA; + int ret = -EINVAL; if (id == 1) { @@ -144,12 +145,10 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) if (id < 2) { - oldhandler = stm32_gpiosetevent(pinset, true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(pinset, true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/nucleo-144/src/stm32_buttons.c b/configs/nucleo-144/src/stm32_buttons.c index 5f622770ad..ea520e8473 100644 --- a/configs/nucleo-144/src/stm32_buttons.c +++ b/configs/nucleo-144/src/stm32_buttons.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -106,16 +107,14 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; if (id == BUTTON_USER) { - oldhandler = stm32_gpiosetevent(GPIO_BTN_USER, true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(GPIO_BTN_USER, true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/nucleo-f303re/src/stm32_buttons.c b/configs/nucleo-f303re/src/stm32_buttons.c index 484abb4e7a..65b046b819 100644 --- a/configs/nucleo-f303re/src/stm32_buttons.c +++ b/configs/nucleo-f303re/src/stm32_buttons.c @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -52,22 +53,6 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -127,16 +112,15 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; if (id == BUTTON_USER) { - oldhandler = stm32_gpiosetevent(GPIO_BTN_USER, true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(GPIO_BTN_USER, true, true, true, irqhandler, + arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif diff --git a/configs/nucleo-f4x1re/src/stm32_buttons.c b/configs/nucleo-f4x1re/src/stm32_buttons.c index 7b1abbaf4f..ab019d2a5c 100644 --- a/configs/nucleo-f4x1re/src/stm32_buttons.c +++ b/configs/nucleo-f4x1re/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,6 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -124,16 +113,14 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; if (id == BUTTON_USER) { - oldhandler = stm32_gpiosetevent(GPIO_BTN_USER, true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(GPIO_BTN_USER, true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/nucleo-l476rg/src/stm32_buttons.c b/configs/nucleo-l476rg/src/stm32_buttons.c index c4a642ecb7..7da458ffb3 100644 --- a/configs/nucleo-l476rg/src/stm32_buttons.c +++ b/configs/nucleo-l476rg/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,6 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -124,16 +113,14 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; if (id == BUTTON_USER) { - oldhandler = stm32_gpiosetevent(GPIO_BTN_USER, true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(GPIO_BTN_USER, true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/olimex-stm32-e407/src/stm32_buttons.c b/configs/olimex-stm32-e407/src/stm32_buttons.c index f5d8aabbe8..870b1ff8a9 100644 --- a/configs/olimex-stm32-e407/src/stm32_buttons.c +++ b/configs/olimex-stm32-e407/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -50,7 +51,7 @@ #ifdef CONFIG_ARCH_BUTTONS /**************************************************************************** - * Private Functions + * Private Data ****************************************************************************/ /* Pin configuration for each Olimex-STM32-H405 button. This array is @@ -134,18 +135,17 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = - stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, + arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/olimex-stm32-h405/src/stm32_buttons.c b/configs/olimex-stm32-h405/src/stm32_buttons.c index 64adcceb9e..c3b6aa92fe 100644 --- a/configs/olimex-stm32-h405/src/stm32_buttons.c +++ b/configs/olimex-stm32-h405/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /* Pin configuration for each Olimex-STM32-H405 button. This array is indexed by * the BUTTON_* definitions in board.h */ @@ -142,18 +135,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/olimex-stm32-h407/src/stm32_buttons.c b/configs/olimex-stm32-h407/src/stm32_buttons.c index 0723f7e938..ed33810dd4 100644 --- a/configs/olimex-stm32-h407/src/stm32_buttons.c +++ b/configs/olimex-stm32-h407/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -50,7 +51,7 @@ #ifdef CONFIG_ARCH_BUTTONS /**************************************************************************** - * Private Functions + * Private Data ****************************************************************************/ /* Pin configuration for each Olimex-STM32-H405 button. This array is indexed by @@ -134,18 +135,17 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, + arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/olimex-stm32-p207/src/stm32_buttons.c b/configs/olimex-stm32-p207/src/stm32_buttons.c index c84325cd99..0002098298 100644 --- a/configs/olimex-stm32-p207/src/stm32_buttons.c +++ b/configs/olimex-stm32-p207/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /* Pin configuration for each STM32F4 Discovery button. This array is indexed by * the BUTTON_* definitions in board.h */ @@ -178,18 +171,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/olimex-stm32-p407/src/stm32_buttons.c b/configs/olimex-stm32-p407/src/stm32_buttons.c index 8833669bf9..6add698e0f 100644 --- a/configs/olimex-stm32-p407/src/stm32_buttons.c +++ b/configs/olimex-stm32-p407/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -52,7 +53,7 @@ #ifdef CONFIG_ARCH_BUTTONS /**************************************************************************** - * Private Functions + * Private Data ****************************************************************************/ /* Pin configuration for each STM32F4 Discovery button. This array is indexed by @@ -172,18 +173,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/olimexino-stm32/src/stm32_buttons.c b/configs/olimexino-stm32/src/stm32_buttons.c index 80decbe831..971bdb79f2 100644 --- a/configs/olimexino-stm32/src/stm32_buttons.c +++ b/configs/olimexino-stm32/src/stm32_buttons.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -50,21 +51,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ + /**************************************************************************** * Button support. * @@ -133,18 +123,17 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id == IRQBUTTON) { - oldhandler = stm32_gpiosetevent(BUTTON_BOOT0n, true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(BUTTON_BOOT0n, true, true, true, irqhandler, + arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/shenzhou/src/stm32_buttons.c b/configs/shenzhou/src/stm32_buttons.c index 6c1f2e806e..515cad297f 100644 --- a/configs/shenzhou/src/stm32_buttons.c +++ b/configs/shenzhou/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,13 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ + /* Pin configuration for each Shenzhou button. This array is indexed by * the BUTTON_* definitions in board.h */ @@ -65,10 +63,6 @@ static const uint32_t g_buttons[NUM_BUTTONS] = GPIO_BTN_USERKEY2, GPIO_BTN_USERKEY, GPIO_BTN_TAMPER, GPIO_BTN_WAKEUP }; -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -157,18 +151,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/spark/src/stm32_buttons.c b/configs/spark/src/stm32_buttons.c index 90c6ceb2db..e41463d6c9 100644 --- a/configs/spark/src/stm32_buttons.c +++ b/configs/spark/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -109,17 +110,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id == BUTTON_USER) { - oldhandler = stm32_gpiosetevent(GPIO_BTN, true, true, true, irqhandler, arg); + ret = stm32_gpiosetevent(GPIO_BTN, true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/stm3210e-eval/src/stm32_buttons.c b/configs/stm3210e-eval/src/stm32_buttons.c index 784e193a9f..043535444c 100644 --- a/configs/stm3210e-eval/src/stm32_buttons.c +++ b/configs/stm3210e-eval/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -162,18 +163,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/stm3220g-eval/src/stm32_buttons.c b/configs/stm3220g-eval/src/stm32_buttons.c index dfae3314a1..115fea249e 100644 --- a/configs/stm3220g-eval/src/stm32_buttons.c +++ b/configs/stm3220g-eval/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /* Pin configuration for each STM3210E-EVAL button. This array is indexed by * the BUTTON_* and JOYSTICK_* definitions in board.h */ @@ -158,18 +151,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/stm3240g-eval/src/stm32_buttons.c b/configs/stm3240g-eval/src/stm32_buttons.c index 9b62581a00..a20c03f16a 100644 --- a/configs/stm3240g-eval/src/stm32_buttons.c +++ b/configs/stm3240g-eval/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -158,18 +159,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/stm32f103-minimum/src/stm32_buttons.c b/configs/stm32f103-minimum/src/stm32_buttons.c index 8f80e17ff5..ebca1469f1 100644 --- a/configs/stm32f103-minimum/src/stm32_buttons.c +++ b/configs/stm32f103-minimum/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -153,18 +154,17 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, + arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif diff --git a/configs/stm32f3discovery/src/stm32_buttons.c b/configs/stm32f3discovery/src/stm32_buttons.c index e643636075..f89fd207a3 100644 --- a/configs/stm32f3discovery/src/stm32_buttons.c +++ b/configs/stm32f3discovery/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /* Pin configuration for each STM32F3Discovery button. This array is indexed by * the BUTTON_* definitions in board.h */ @@ -153,18 +146,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/stm32f429i-disco/src/stm32_buttons.c b/configs/stm32f429i-disco/src/stm32_buttons.c index c904d4abb6..a6ffed5433 100644 --- a/configs/stm32f429i-disco/src/stm32_buttons.c +++ b/configs/stm32f429i-disco/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /* Pin configuration for each STM32F4 Discovery button. This array is indexed by * the BUTTON_* definitions in board.h */ @@ -153,18 +146,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/stm32f4discovery/src/stm32_buttons.c b/configs/stm32f4discovery/src/stm32_buttons.c index f1b38d7811..449001f13a 100644 --- a/configs/stm32f4discovery/src/stm32_buttons.c +++ b/configs/stm32f4discovery/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /* Pin configuration for each STM32F4 Discovery button. This array is indexed by * the BUTTON_* definitions in board.h */ @@ -153,18 +146,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/stm32ldiscovery/src/stm32_buttons.c b/configs/stm32ldiscovery/src/stm32_buttons.c index d4d05821f1..f599b0c851 100644 --- a/configs/stm32ldiscovery/src/stm32_buttons.c +++ b/configs/stm32ldiscovery/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,18 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /* Pin configuration for each STM32F3Discovery button. This array is indexed by * the BUTTON_* definitions in board.h */ @@ -153,18 +146,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/stm32vldiscovery/src/stm32_buttons.c b/configs/stm32vldiscovery/src/stm32_buttons.c index 47d3b2fd1b..259cfee756 100644 --- a/configs/stm32vldiscovery/src/stm32_buttons.c +++ b/configs/stm32vldiscovery/src/stm32_buttons.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -108,15 +109,14 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; if (id == 0) { - oldhandler = stm32_gpiosetevent(GPIO_BTN_0, true, true, true, irqhandler, arg); + ret = stm32_gpiosetevent(GPIO_BTN_0, true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/configs/viewtool-stm32f107/src/stm32_buttons.c b/configs/viewtool-stm32f107/src/stm32_buttons.c index b29e0d3131..9039e72e09 100644 --- a/configs/viewtool-stm32f107/src/stm32_buttons.c +++ b/configs/viewtool-stm32f107/src/stm32_buttons.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -49,13 +50,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ + /* Pin configuration for each STM3210E-EVAL button. This array is indexed by * the BUTTON_* and JOYSTICK_* definitions in board.h */ @@ -65,10 +63,6 @@ static const uint32_t g_buttons[NUM_BUTTONS] = GPIO_SW2, GPIO_SW3, GPIO_SW4 }; -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -153,18 +147,16 @@ uint8_t board_buttons(void) #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - xcpt_t oldhandler = NULL; + int ret = -EINVAL; /* The following should be atomic */ if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) { - oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, - irqhandler, arg); + ret = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); } - UNUSED(oldhandler); - return OK; + return ret; } #endif #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/drivers/wireless/cc1101.c b/drivers/wireless/cc1101.c index e42fe08572..e9ce3805c5 100644 --- a/drivers/wireless/cc1101.c +++ b/drivers/wireless/cc1101.c @@ -585,11 +585,10 @@ struct cc1101_dev_s *cc1101_init(struct spi_dev_s *spi, uint8_t isrpin, cc1101_setgdo(dev, dev->isrpin, CC1101_GDO_SYNC); - /* Bind to external interrupt line */ - - /* depends on STM32: TODO: Make that config within pinset and - * provide general gpio interface - * stm32_gpiosetevent(pinset, false, true, true, cc1101_eventcb); + /* Configure to receive interrupts on the external GPIO interrupt line. + * + * REVISIT: There is no MCU-independent way to do this in this + * context. */ return dev; @@ -599,8 +598,11 @@ int cc1101_deinit(struct cc1101_dev_s *dev) { ASSERT(dev); - /* Release interrupt */ - /* stm32_gpiosetevent(pinset, false, false, false, NULL); */ + /* Release the external GPIO interrupt + * + * REVISIT: There is no MCU-independent way to do this in this + * context. + */ /* Power down chip */