diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-06-26 12:39:23 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-06-26 12:39:23 +0000 |
commit | 9eb6e49a56899f4347f96a6fbaa4bc89fd6e411c (patch) | |
tree | e7a8ec3cdf98cfb7dc1c2083f5425dd7511428ac | |
parent | 45062eebeb8e3cca452ad08861f047106a101597 (diff) | |
download | nuttx-9eb6e49a56899f4347f96a6fbaa4bc89fd6e411c.tar.gz nuttx-9eb6e49a56899f4347f96a6fbaa4bc89fd6e411c.tar.bz2 nuttx-9eb6e49a56899f4347f96a6fbaa4bc89fd6e411c.zip |
Simplify STM32 PM infrastructure
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4870 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/arch/arm/src/stm32/Make.defs | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_pm.h | 18 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_pminitialize.c | 13 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_pmstandby.c | 4 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_pmstop.c | 4 |
5 files changed, 2 insertions, 39 deletions
diff --git a/nuttx/arch/arm/src/stm32/Make.defs b/nuttx/arch/arm/src/stm32/Make.defs index 88ac64812..cae6bfc57 100644 --- a/nuttx/arch/arm/src/stm32/Make.defs +++ b/nuttx/arch/arm/src/stm32/Make.defs @@ -86,8 +86,10 @@ endif CHIP_CSRCS += stm32_pmstop.c stm32_pmstandby.c ifeq ($(CONFIG_PM),y) +ifneq ($(CONFIG_PM_CUSTOMINIT),y) CHIP_CSRCS += stm32_pminitialize.c endif +endif ifeq ($(CONFIG_STM32_ETHMAC),y) CHIP_CSRCS += stm32_eth.c diff --git a/nuttx/arch/arm/src/stm32/stm32_pm.h b/nuttx/arch/arm/src/stm32/stm32_pm.h index 25c56ecbb..d08458d78 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pm.h +++ b/nuttx/arch/arm/src/stm32/stm32_pm.h @@ -43,7 +43,6 @@ #include <nuttx/config.h> #include <stdbool.h> -#include <semaphore.h> #include "chip.h" #include "up_internal.h" @@ -68,15 +67,6 @@ extern "C" { #define EXTERN extern #endif -/* Before any power state transition is made, the caller should hold this - * semaphore to assure that there are no concurrent, contradictory power - * state activities. - */ - -#ifdef CONFIG_PM -EXTERN sem_t g_pmsem; -#endif - /**************************************************************************** * Public Function Prototypes ****************************************************************************/ @@ -98,10 +88,6 @@ EXTERN sem_t g_pmsem; * original state. Otherwise, STOP mode did not occur and a negated * errno value is returned to indicate the cause of the failure. * - * Assumptions: - * The caller holds the PM semaphore (g_pmsem) if this function is used - * as part of the NuttX power management logic. - * ****************************************************************************/ EXTERN int stm32_pmstop(bool lpds); @@ -121,10 +107,6 @@ EXTERN int stm32_pmstop(bool lpds); * and a negated errno value is returned to indicate the cause of the * failure. * - * Assumptions: - * The caller holds the PM semaphore (g_pmsem) if this function is used - * as part of the NuttX power management logic. - * ****************************************************************************/ EXTERN int stm32_pmstandby(void); diff --git a/nuttx/arch/arm/src/stm32/stm32_pminitialize.c b/nuttx/arch/arm/src/stm32/stm32_pminitialize.c index f065cdfc8..a1f44a7f4 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pminitialize.c +++ b/nuttx/arch/arm/src/stm32/stm32_pminitialize.c @@ -58,13 +58,6 @@ * Public Data ****************************************************************************/ -/* Before any power state transition is made, the caller should hold this - * semaphore to assure that there are no concurrent, contradictory power - * state activities. - */ - -sem_t g_pmsem; - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -93,12 +86,6 @@ sem_t g_pmsem; void up_pminitialize(void) { - /* Initialize the PM semaphore to assure that no more than one power-related - * action occurs at a time. - */ - - sem_init(&g_pmsem, 0, 1); - /* Then initialize the NuttX power management subsystem proper */ pm_initialize(); diff --git a/nuttx/arch/arm/src/stm32/stm32_pmstandby.c b/nuttx/arch/arm/src/stm32/stm32_pmstandby.c index 6846ac1f1..9aacfaa9a 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pmstandby.c +++ b/nuttx/arch/arm/src/stm32/stm32_pmstandby.c @@ -77,10 +77,6 @@ * and a negated errno value is returned to indicate the cause of the * failure. * - * Assumptions: - * The caller holds the PM semaphore (g_pmsem) if this function is used - * as part of the NuttX power management logic. - * ****************************************************************************/ int stm32_pmstandby(void) diff --git a/nuttx/arch/arm/src/stm32/stm32_pmstop.c b/nuttx/arch/arm/src/stm32/stm32_pmstop.c index 55e8201c6..c68885611 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pmstop.c +++ b/nuttx/arch/arm/src/stm32/stm32_pmstop.c @@ -79,10 +79,6 @@ * original state. Otherwise, STOP mode did not occur and a negated * errno value is returned to indicate the cause of the failure. * - * Assumptions: - * The caller holds the PM semaphore (g_pmsem) if this function is used - * as part of the NuttX power management logic. - * ****************************************************************************/ int stm32_pmstop(bool lpds) |