From 41bec181a3c306b2006523305bead57dad8a7992 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 30 Jun 2012 00:53:54 +0000 Subject: PM Update; add configs//ekk-lm3s9b96 git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4888 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/src/stm32/stm32_pmstop.c | 12 ++++++++++-- nuttx/arch/arm/src/stm32/stm32_serial.c | 28 ++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) (limited to 'nuttx/arch/arm/src/stm32') diff --git a/nuttx/arch/arm/src/stm32/stm32_pmstop.c b/nuttx/arch/arm/src/stm32/stm32_pmstop.c index c68885611..9bd4af73a 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pmstop.c +++ b/nuttx/arch/arm/src/stm32/stm32_pmstop.c @@ -107,8 +107,16 @@ int stm32_pmstop(bool lpds) regval |= NVIC_SYSCON_SLEEPDEEP; putreg32(regval, NVIC_SYSCON); - /* Sleep until the wakeup interrupt occurs (us WFE to wait for an event) */ + /* Sleep until the wakeup interrupt or event occurs */ - asm("WFI"); +#ifdef CONFIG_PM_WFE + /* Mode: SLEEP + Entry with WFE */ + + __asm("wfe"); +#else + /* Mode: SLEEP + Entry with WFI */ + + __asm("wfi"); +#endif return OK; } diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c index ab456eeb5..a5864acb6 100644 --- a/nuttx/arch/arm/src/stm32/stm32_serial.c +++ b/nuttx/arch/arm/src/stm32/stm32_serial.c @@ -132,8 +132,8 @@ /* Power management definitions */ -#if defined(CONFIG_PM) && !defined(CONFG_PM_SERIAL_ACTIVITY) -# define CONFG_PM_SERIAL_ACTIVITY 10 +#if defined(CONFIG_PM) && !defined(CONFIG_PM_SERIAL_ACTIVITY) +# define CONFIG_PM_SERIAL_ACTIVITY 10 #endif #ifdef USE_SERIALDRIVER @@ -1089,8 +1089,8 @@ static int up_interrupt_common(struct up_dev_s *priv) /* Report serial activity to the power management logic */ -#if defined(CONFIG_PM) && CONFG_PM_SERIAL_ACTIVITY > 0 - pm_activity(CONFG_PM_SERIAL_ACTIVITY); +#if defined(CONFIG_PM) && CONFIG_PM_SERIAL_ACTIVITY > 0 + pm_activity(CONFIG_PM_SERIAL_ACTIVITY); #endif /* Loop until there are no characters to be transferred or, @@ -1589,19 +1589,31 @@ static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate) switch (pmstate) { case(PM_NORMAL): - /* Logic for PM_NORMAL goes here */ + { + /* Logic for PM_NORMAL goes here */ + + } break; case(PM_IDLE): - /* Logic for PM_IDLE goes here */ + { + /* Logic for PM_IDLE goes here */ + + } break; case(PM_STANDBY): - /* Logic for PM_STANDBY goes here */ + { + /* Logic for PM_STANDBY goes here */ + + } break; case(PM_SLEEP): - /* Logic for PM_SLEEP goes here */ + { + /* Logic for PM_SLEEP goes here */ + + } break; default: -- cgit v1.2.3