diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-07-04 00:06:25 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-07-04 00:06:25 +0000 |
commit | 8b886b98d9cfb72c16fb3ec73db636525d91f4b7 (patch) | |
tree | 8c699ad162a547dfee28274d0d13439390938c4b /nuttx/configs/stm3210e-eval/src/up_idle.c | |
parent | 05b3e348f4872bd78dcc3a97a5d86082e119fc40 (diff) | |
download | px4-firmware-8b886b98d9cfb72c16fb3ec73db636525d91f4b7.tar.gz px4-firmware-8b886b98d9cfb72c16fb3ec73db636525d91f4b7.tar.bz2 px4-firmware-8b886b98d9cfb72c16fb3ec73db636525d91f4b7.zip |
LMS3 and PM update
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4902 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/configs/stm3210e-eval/src/up_idle.c')
-rw-r--r-- | nuttx/configs/stm3210e-eval/src/up_idle.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/nuttx/configs/stm3210e-eval/src/up_idle.c b/nuttx/configs/stm3210e-eval/src/up_idle.c index 9b6432da8..27784056b 100644 --- a/nuttx/configs/stm3210e-eval/src/up_idle.c +++ b/nuttx/configs/stm3210e-eval/src/up_idle.c @@ -123,23 +123,43 @@ static void up_idlepm(void) switch (newstate) { case PM_NORMAL: + break; case PM_IDLE: + { + /* Check if the buttons have already been registered */ + + up_unregisterbuttons(); + + /* Initialize the buttoms to wake up the system from the idle + * mode + */ + + up_pmbuttons(); + } break; case PM_STANDBY: - /* Configure all the buttons as wakeup EXTI */ + { + /* Check if the buttons have already been registered */ + + up_unregisterbuttons(); - up_pmbuttons(); + /* Configure all the buttons as wakeup EXTI */ - /* Call the STM32 stop mode */ + up_pmbuttons(); - stm32_pmstop(true); + /* Call the STM32 stop mode */ + + stm32_pmstop(true); + } break; case PM_SLEEP: - (void)stm32_pmstandby(); + { + (void)stm32_pmstandby(); + } break; default: @@ -182,12 +202,8 @@ void up_idle(void) /* Perform IDLE mode power management */ - up_idlepm(); - - /* Sleep until an interrupt occurs to save power */ - BEGIN_IDLE(); - __asm("wfi"); + up_idlepm(); END_IDLE(); #endif } |