summaryrefslogtreecommitdiff
path: root/nuttx/configs/stm3210e-eval/src
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/configs/stm3210e-eval/src')
-rw-r--r--nuttx/configs/stm3210e-eval/src/stm3210e-internal.h12
-rw-r--r--nuttx/configs/stm3210e-eval/src/up_idle.c30
-rw-r--r--nuttx/configs/stm3210e-eval/src/up_pm.c6
-rw-r--r--nuttx/configs/stm3210e-eval/src/up_pmbuttons.c23
4 files changed, 6 insertions, 65 deletions
diff --git a/nuttx/configs/stm3210e-eval/src/stm3210e-internal.h b/nuttx/configs/stm3210e-eval/src/stm3210e-internal.h
index d0ff66cf4..33a8750f9 100644
--- a/nuttx/configs/stm3210e-eval/src/stm3210e-internal.h
+++ b/nuttx/configs/stm3210e-eval/src/stm3210e-internal.h
@@ -317,18 +317,6 @@ void up_ledpminitialize(void);
void up_pmbuttons(void);
#endif
-/************************************************************************************
- * Name: up_unregisterbuttons
- *
- * Description:
- * Un-register button handlers
- *
- ************************************************************************************/
-
-#if defined(CONFIG_PM) && defined(CONFIG_IDLE_CUSTOM) && defined(CONFIG_PM_BUTTONS)
-void up_unregisterbuttons(void);
-#endif
-
#endif /* __ASSEMBLY__ */
#endif /* __CONFIGS_STM3210E_EVAL_SRC_STM3210E_INTERNAL_H */
diff --git a/nuttx/configs/stm3210e-eval/src/up_idle.c b/nuttx/configs/stm3210e-eval/src/up_idle.c
index f68574bd8..bc5be2bdc 100644
--- a/nuttx/configs/stm3210e-eval/src/up_idle.c
+++ b/nuttx/configs/stm3210e-eval/src/up_idle.c
@@ -150,41 +150,11 @@ static void up_idlepm(void)
case PM_IDLE:
{
- /* The wake-up event is really dependent upon the application
- * an resources provided by the application. However,
- * CONFIG_PM_BUTTONS may defined to support PM testing.
- */
-
-#ifdef CONFIG_PM_BUTTONS
- /* Check if the buttons have already been registered */
-
- up_unregisterbuttons();
-
- /* Initialize the buttons to wake up the system from the idle
- * mode
- */
-
- up_pmbuttons();
-#endif
}
break;
case PM_STANDBY:
{
- /* The wake-up event is really dependent upon the application
- * an resources provided by the application. However,
- * CONFIG_PM_BUTTONS may defined to support PM testing.
- */
-
-#ifdef CONFIG_PM_BUTTONS
- /* Check if the buttons have already been registered */
-
- up_unregisterbuttons();
-
- /* Configure all the buttons as wakeup EXTI */
-
- up_pmbuttons();
-#endif
#ifdef CONFIG_RTC_ALARM
/* Configure the RTC alarm to Auto Wake the system */
diff --git a/nuttx/configs/stm3210e-eval/src/up_pm.c b/nuttx/configs/stm3210e-eval/src/up_pm.c
index 069a0cb5f..dd8a79b1c 100644
--- a/nuttx/configs/stm3210e-eval/src/up_pm.c
+++ b/nuttx/configs/stm3210e-eval/src/up_pm.c
@@ -93,6 +93,12 @@ void up_pminitialize(void)
pm_initialize();
+#ifdef CONFIG_PM_BUTTONS
+ /* Initialize the buttons to wake up the system from low power modes */
+
+ up_pmbuttons();
+#endif
+
/* Initialize the LED PM */
up_ledpminitialize();
diff --git a/nuttx/configs/stm3210e-eval/src/up_pmbuttons.c b/nuttx/configs/stm3210e-eval/src/up_pmbuttons.c
index 0a214d709..5892ce626 100644
--- a/nuttx/configs/stm3210e-eval/src/up_pmbuttons.c
+++ b/nuttx/configs/stm3210e-eval/src/up_pmbuttons.c
@@ -281,10 +281,6 @@ static void button_handler(int id, int irq)
*/
pm_activity(CONFIG_PM_BUTTON_ACTIVITY);
-
- /* Un-register button handlers */
-
- up_unregisterbuttons();
}
#if MIN_BUTTON < 1
@@ -387,23 +383,4 @@ void up_pmbuttons(void)
#endif
}
-/****************************************************************************
- * Name: up_unregisterbuttons
- *
- * Description:
- * Un-register button handlers
- *
- ****************************************************************************/
-
-void up_unregisterbuttons(void)
-{
-#ifdef CONFIG_ARCH_IRQBUTTONS
-int i;
- for (i = CONFIG_PM_IRQBUTTONS_MIN; i <= CONFIG_PM_IRQBUTTONS_MAX; i++)
- {
- (void)up_irqbutton(i, NULL);
- }
-#endif
-}
-
#endif /* defined(CONFIG_PM) && defined(CONFIG_IDLE_CUSTOM) && defined(CONFIG_PM_BUTTONS) */