diff --git a/arch/arm/src/efm32/efm32_idle.c b/arch/arm/src/efm32/efm32_idle.c index 5c3d6270bc..62d4e6315b 100644 --- a/arch/arm/src/efm32/efm32_idle.c +++ b/arch/arm/src/efm32/efm32_idle.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/efm32/efm32_idle.c * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,8 @@ # define END_IDLE() #endif +#define PM_IDLE_DOMAIN 0 /* Revisit */ + /**************************************************************************** * Private Data ****************************************************************************/ @@ -98,7 +100,7 @@ static void up_idlepm(void) /* Decide, which power saving level can be obtained */ - newstate = pm_checkstate(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); /* Check for state changes */ @@ -112,12 +114,12 @@ static void up_idlepm(void) /* Then force the global state change */ - ret = pm_changestate(newstate); + ret = pm_changestate(PM_IDLE_DOMAIN, newstate); if (ret < 0) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(oldstate); + (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { diff --git a/arch/arm/src/kl/kl_idle.c b/arch/arm/src/kl/kl_idle.c index 380291611d..e711b39e3c 100644 --- a/arch/arm/src/kl/kl_idle.c +++ b/arch/arm/src/kl/kl_idle.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/kl/kl_idle.c * - * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,8 @@ # define END_IDLE() #endif +#define PM_IDLE_DOMAIN 0 /* Revisit */ + /**************************************************************************** * Private Data ****************************************************************************/ @@ -91,7 +93,7 @@ static void up_idlepm(void) /* Decide, which power saving level can be obtained */ - newstate = pm_checkstate(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); /* Check for state changes */ @@ -105,12 +107,12 @@ static void up_idlepm(void) /* Then force the global state change */ - ret = pm_changestate(newstate); + ret = pm_changestate(PM_IDLE_DOMAIN, newstate); if (ret < 0) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(oldstate); + (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { diff --git a/arch/arm/src/lpc43xx/lpc43_idle.c b/arch/arm/src/lpc43xx/lpc43_idle.c index cd59d9d1ab..62f665495e 100644 --- a/arch/arm/src/lpc43xx/lpc43_idle.c +++ b/arch/arm/src/lpc43xx/lpc43_idle.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc43/lpc43_idle.c * - * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -64,9 +64,7 @@ # define END_IDLE() #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ +#define PM_IDLE_DOMAIN 0 /* Revisit */ /**************************************************************************** * Private Functions @@ -90,7 +88,7 @@ static void up_idlepm(void) /* Decide, which power saving level can be obtained */ - newstate = pm_checkstate(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); /* Check for state changes */ @@ -104,12 +102,12 @@ static void up_idlepm(void) /* Then force the global state change */ - ret = pm_changestate(newstate); + ret = pm_changestate(PM_IDLE_DOMAIN, newstate); if (ret < 0) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(oldstate); + (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { diff --git a/arch/arm/src/nuc1xx/nuc_idle.c b/arch/arm/src/nuc1xx/nuc_idle.c index db4c46e796..9dd225313f 100644 --- a/arch/arm/src/nuc1xx/nuc_idle.c +++ b/arch/arm/src/nuc1xx/nuc_idle.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/nuc1xx/nuc_idle.c * - * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,9 +65,7 @@ # define END_IDLE() #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ +#define PM_IDLE_DOMAIN 0 /* Revisit */ /**************************************************************************** * Private Functions @@ -91,7 +89,7 @@ static void up_idlepm(void) /* Decide, which power saving level can be obtained */ - newstate = pm_checkstate(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); /* Check for state changes */ @@ -105,12 +103,12 @@ static void up_idlepm(void) /* Then force the global state change */ - ret = pm_changestate(newstate); + ret = pm_changestate(PM_IDLE_DOMAIN, newstate); if (ret < 0) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(oldstate); + (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { diff --git a/arch/arm/src/samdl/sam_idle.c b/arch/arm/src/samdl/sam_idle.c index 97326e342d..be58de12be 100644 --- a/arch/arm/src/samdl/sam_idle.c +++ b/arch/arm/src/samdl/sam_idle.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/samdl/sam_idle.c * - * Copyright (C) 2014, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,9 +65,7 @@ # define END_IDLE() #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ +#define PM_IDLE_DOMAIN 0 /* Revisit */ /**************************************************************************** * Private Functions @@ -91,7 +89,7 @@ static void up_idlepm(void) /* Decide, which power saving level can be obtained */ - newstate = pm_checkstate(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); /* Check for state changes */ @@ -105,12 +103,12 @@ static void up_idlepm(void) /* Then force the global state change */ - ret = pm_changestate(newstate); + ret = pm_changestate(PM_IDLE_DOMAIN, newstate); if (ret < 0) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(oldstate); + (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { diff --git a/arch/arm/src/stm32/stm32_idle.c b/arch/arm/src/stm32/stm32_idle.c index 54553e974d..0786f2ac99 100644 --- a/arch/arm/src/stm32/stm32_idle.c +++ b/arch/arm/src/stm32/stm32_idle.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32/stm32_idle.c * - * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -67,9 +67,7 @@ # define END_IDLE() #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ +#define PM_IDLE_DOMAIN 0 /* Revisit */ /**************************************************************************** * Private Functions @@ -93,7 +91,7 @@ static void up_idlepm(void) /* Decide, which power saving level can be obtained */ - newstate = pm_checkstate(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); /* Check for state changes */ @@ -107,12 +105,12 @@ static void up_idlepm(void) /* Then force the global state change */ - ret = pm_changestate(newstate); + ret = pm_changestate(PM_IDLE_DOMAIN, newstate); if (ret < 0) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(oldstate); + (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 25927cad73..2e11d52609 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32/stm32_serial.c * - * Copyright (C) 2009-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -252,6 +252,7 @@ #if defined(CONFIG_PM) && !defined(CONFIG_PM_SERIAL_ACTIVITY) # define CONFIG_PM_SERIAL_ACTIVITY 10 +# define PM_IDLE_DOMAIN 0 /* Revisit */ #endif #ifdef USE_SERIALDRIVER @@ -363,8 +364,10 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg); #endif #ifdef CONFIG_PM -static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate); -static int up_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate); +static void up_pm_notify(struct pm_callback_s *cb, int dowmin, + enum pm_state_e pmstate); +static int up_pm_prepare(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate); #endif #ifdef CONFIG_STM32_USART1 @@ -1779,7 +1782,7 @@ static int up_interrupt_common(struct up_dev_s *priv) /* Report serial activity to the power management logic */ #if defined(CONFIG_PM) && CONFIG_PM_SERIAL_ACTIVITY > 0 - pm_activity(CONFIG_PM_SERIAL_ACTIVITY); + pm_activity(PM_IDLE_DOMAIN, CONFIG_PM_SERIAL_ACTIVITY); #endif /* Loop until there are no characters to be transferred or, @@ -2613,7 +2616,8 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg) ****************************************************************************/ #ifdef CONFIG_PM -static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate) +static void up_pm_notify(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate) { switch (pmstate) { @@ -2686,7 +2690,8 @@ static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate) ****************************************************************************/ #ifdef CONFIG_PM -static int up_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate) +static int up_pm_prepare(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate) { /* Logic to prepare for a reduced power state goes here. */ diff --git a/arch/arm/src/stm32f7/stm32_serial.c b/arch/arm/src/stm32f7/stm32_serial.c index bdc3717ed4..d62b78fd6e 100644 --- a/arch/arm/src/stm32f7/stm32_serial.c +++ b/arch/arm/src/stm32f7/stm32_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32f7/stm32_serial.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -205,6 +205,7 @@ #if defined(CONFIG_PM) && !defined(CONFIG_PM_SERIAL_ACTIVITY) # define CONFIG_PM_SERIAL_ACTIVITY 10 +# define PM_IDLE_DOMAIN 0 /* Revisit */ #endif #ifdef USE_SERIALDRIVER @@ -317,8 +318,10 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg); #endif #ifdef CONFIG_PM -static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate); -static int up_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate); +static void up_pm_notify(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate); +static int up_pm_prepare(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate); #endif #ifdef CONFIG_STM32F7_USART1 @@ -1711,7 +1714,7 @@ static int up_interrupt_common(struct up_dev_s *priv) /* Report serial activity to the power management logic */ #if defined(CONFIG_PM) && CONFIG_PM_SERIAL_ACTIVITY > 0 - pm_activity(CONFIG_PM_SERIAL_ACTIVITY); + pm_activity(PM_IDLE_DOMAIN, CONFIG_PM_SERIAL_ACTIVITY); #endif /* Loop until there are no characters to be transferred or, @@ -2543,7 +2546,8 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg) ****************************************************************************/ #ifdef CONFIG_PM -static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate) +static void up_pm_notify(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate) { switch (pmstate) { @@ -2616,7 +2620,8 @@ static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate) ****************************************************************************/ #ifdef CONFIG_PM -static int up_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate) +static int up_pm_prepare(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate) { /* Logic to prepare for a reduced power state goes here. */ diff --git a/arch/arm/src/stm32l4/stm32l4_idle.c b/arch/arm/src/stm32l4/stm32l4_idle.c index c1046508e9..7cf0734c22 100644 --- a/arch/arm/src/stm32l4/stm32l4_idle.c +++ b/arch/arm/src/stm32l4/stm32l4_idle.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32l4/stm32l4_idle.c * - * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -67,9 +67,7 @@ # define END_IDLE() #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ +#define PM_IDLE_DOMAIN 0 /* Revisit */ /**************************************************************************** * Private Functions @@ -93,7 +91,7 @@ static void up_idlepm(void) /* Decide, which power saving level can be obtained */ - newstate = pm_checkstate(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); /* Check for state changes */ @@ -107,12 +105,12 @@ static void up_idlepm(void) /* Then force the global state change */ - ret = pm_changestate(newstate); + ret = pm_changestate(PM_IDLE_DOMAIN, newstate); if (ret < 0) { /* The new state change failed, revert to the preceding state */ - (void)pm_changestate(oldstate); + (void)pm_changestate(PM_IDLE_DOMAIN, oldstate); } else { diff --git a/arch/arm/src/stm32l4/stm32l4_lse.c b/arch/arm/src/stm32l4/stm32l4_lse.c index 3cd028b283..cc193e949e 100644 --- a/arch/arm/src/stm32l4/stm32l4_lse.c +++ b/arch/arm/src/stm32l4/stm32l4_lse.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32l4/stm32l4_lse.c * - * Copyright (C) 2009, 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: dev@ziggurat29.com * * Redistribution and use in source and binary forms, with or without @@ -45,18 +45,6 @@ #include "stm32l4_rcc.h" #include "stm32l4_waste.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -88,8 +76,8 @@ void stm32l4_rcc_enablelse(void) * the RCC BDCR register. */ - regval = getreg32(STM32L4_RCC_BDCR); - regval |= RCC_BDCR_LSEON|RCC_BDCR_LSEDRV_MIDHI; + regval = getreg32(STM32L4_RCC_BDCR); + regval |= RCC_BDCR_LSEON | RCC_BDCR_LSEDRV_MIDHI; putreg32(regval,STM32L4_RCC_BDCR); /* Wait for the LSE clock to be ready */ diff --git a/arch/arm/src/stm32l4/stm32l4_pwr.c b/arch/arm/src/stm32l4/stm32l4_pwr.c index d17c9d6fba..972388e82d 100644 --- a/arch/arm/src/stm32l4/stm32l4_pwr.c +++ b/arch/arm/src/stm32l4/stm32l4_pwr.c @@ -2,7 +2,7 @@ * arch/arm/src/stm32l4/stm32l4_pwr.c * * Copyright (C) 2011 Uros Platise. All rights reserved. - * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015-2016 Gregory Nutt. All rights reserved. * Authors: Uros Platise * Gregory Nutt * dev@ziggurat29.com @@ -51,11 +51,6 @@ #include "stm32l4_pwr.h" #include "stm32l4_rcc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - /************************************************************************************ * Private Functions ************************************************************************************/ @@ -103,8 +98,7 @@ bool stm32l4_pwr_enableclk(bool enable) regval = getreg32(STM32L4_RCC_APB1ENR1); wasenabled = ((regval & RCC_APB1ENR1_PWREN) != 0); - /* Power interface clock enable. - */ + /* Power interface clock enable. */ if (wasenabled && !enable) { diff --git a/arch/arm/src/stm32l4/stm32l4_pwr.h b/arch/arm/src/stm32l4/stm32l4_pwr.h index b22eebb06c..6c065f3d44 100644 --- a/arch/arm/src/stm32l4/stm32l4_pwr.h +++ b/arch/arm/src/stm32l4/stm32l4_pwr.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/stm32l4/stm32l4_pwr.h * - * Copyright (C) 2009, 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: dev@ziggurat29.com * * Redistribution and use in source and binary forms, with or without @@ -84,7 +84,6 @@ extern "C" bool stm32l4_pwr_enableclk(bool enable); - /************************************************************************************ * Name: stm32l4_pwr_enablebkp * diff --git a/arch/arm/src/stm32l4/stm32l4_serial.c b/arch/arm/src/stm32l4/stm32l4_serial.c index 734ea211d9..68e9e75245 100644 --- a/arch/arm/src/stm32l4/stm32l4_serial.c +++ b/arch/arm/src/stm32l4/stm32l4_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32l4/stm32l4_serial.c * - * Copyright (C) 2009-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -205,6 +205,7 @@ #if defined(CONFIG_PM) && !defined(CONFIG_PM_SERIAL_ACTIVITY) # define CONFIG_PM_SERIAL_ACTIVITY 10 +# define PM_IDLE_DOMAIN 0 /* Revisit */ #endif #ifdef USE_SERIALDRIVER @@ -316,8 +317,10 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg); #endif #ifdef CONFIG_PM -static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate); -static int up_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate); +static void up_pm_notify(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate); +static int up_pm_prepare(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate); #endif #ifdef CONFIG_STM32L4_USART1 @@ -1454,7 +1457,7 @@ static int up_interrupt_common(struct up_dev_s *priv) /* Report serial activity to the power management logic */ #if defined(CONFIG_PM) && CONFIG_PM_SERIAL_ACTIVITY > 0 - pm_activity(CONFIG_PM_SERIAL_ACTIVITY); + pm_activity(PM_IDLE_DOMAIN, CONFIG_PM_SERIAL_ACTIVITY); #endif /* Loop until there are no characters to be transferred or, @@ -2255,7 +2258,8 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg) ****************************************************************************/ #ifdef CONFIG_PM -static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate) +static void up_pm_notify(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate) { switch (pmstate) { @@ -2328,7 +2332,8 @@ static void up_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate) ****************************************************************************/ #ifdef CONFIG_PM -static int up_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate) +static int up_pm_prepare(struct pm_callback_s *cb, int domain, + enum pm_state_e pmstate) { /* Logic to prepare for a reduced power state goes here. */ diff --git a/arch/arm/src/stm32l4/stm32l4x6xx_rcc.c b/arch/arm/src/stm32l4/stm32l4x6xx_rcc.c index e390120727..8e4cbe624c 100644 --- a/arch/arm/src/stm32l4/stm32l4x6xx_rcc.c +++ b/arch/arm/src/stm32l4/stm32l4x6xx_rcc.c @@ -581,7 +581,7 @@ static void stm32l4_stdclockconfig(void) # error STM32L4_BOARD_USEMSI not yet implemented in arch/arm/src/stm32l4/stm32l4x6xx_rcc.c /* setting MSIRANGE */ /* setting MSIPLLEN */ - + regval = getreg32(STM32L4_RCC_CR); regval |= RCC_CR_MSION; /* Enable MSI */ putreg32(regval, STM32L4_RCC_CR); @@ -621,9 +621,8 @@ static void stm32l4_stdclockconfig(void) { #warning todo: regulator voltage according to clock freq #if 0 - /* ensure Power control is enabled before modifying it - */ - + /* Ensure Power control is enabled before modifying it. */ + regval = getreg32(STM32L4_RCC_APB1ENR); regval |= RCC_APB1ENR_PWREN; putreg32(regval, STM32L4_RCC_APB1ENR); @@ -631,7 +630,7 @@ static void stm32l4_stdclockconfig(void) /* Select regulator voltage output Scale 1 mode to support system * frequencies up to 168 MHz. */ - + regval = getreg32(STM32L4_PWR_CR); regval &= ~PWR_CR_VOS_MASK; regval |= PWR_CR_VOS_SCALE_1; diff --git a/arch/sim/src/up_idle.c b/arch/sim/src/up_idle.c index 1459845c15..2e218b319d 100644 --- a/arch/sim/src/up_idle.c +++ b/arch/sim/src/up_idle.c @@ -54,6 +54,12 @@ #include "up_internal.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define PM_IDLE_DOMAIN 0 /* Revisit */ + /**************************************************************************** * Private Data ****************************************************************************/ @@ -149,10 +155,10 @@ void up_idle(void) static enum pm_state_e state = PM_NORMAL; enum pm_state_e newstate; - newstate = pm_checkstate(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); if (newstate != state) { - if (pm_changestate(newstate) == OK) + if (pm_changestate(PM_IDLE_DOMAIN, newstate) == OK) { state = newstate; }