diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-06-26 12:39:23 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-06-26 12:39:23 +0000 |
commit | 49c6fed332d7df61b819e29922fe96afd8c0ca16 (patch) | |
tree | e7a8ec3cdf98cfb7dc1c2083f5425dd7511428ac /nuttx/arch | |
parent | 32c100bf9491aeefdf3931234b8700cfcf9fcc8b (diff) | |
download | px4-firmware-49c6fed332d7df61b819e29922fe96afd8c0ca16.tar.gz px4-firmware-49c6fed332d7df61b819e29922fe96afd8c0ca16.tar.bz2 px4-firmware-49c6fed332d7df61b819e29922fe96afd8c0ca16.zip |
Simplify STM32 PM infrastructure
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4870 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch')
-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) |