Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions arch/risc-v/src/common/espressif/esp_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ static void up_idlepm(void)
/* Keep working in normal stage */

pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);

/* Release the stay above: it only forces this one state change. */

pm_relax(PM_IDLE_DOMAIN, PM_NORMAL);
newstate = PM_NORMAL;
}

Expand Down Expand Up @@ -158,32 +162,32 @@ static void up_idlepm(void)

switch (newstate)
{
case PM_NORMAL:
break;
case PM_NORMAL:
break;

case PM_IDLE:
break;
case PM_IDLE:
break;

case PM_STANDBY:
{
/* Enter Force-sleep mode */
case PM_STANDBY:
{
/* Enter Force-sleep mode */

esp_pmstandby(CONFIG_PM_ALARM_SEC * 1000000 +
CONFIG_PM_ALARM_NSEC / 1000);
}
break;
esp_pmstandby(CONFIG_PM_ALARM_SEC * 1000000 +
CONFIG_PM_ALARM_NSEC / 1000);
}
break;

case PM_SLEEP:
{
/* Enter Deep-sleep mode */
case PM_SLEEP:
{
/* Enter Deep-sleep mode */

esp_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}
break;
esp_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}
break;

default:
break;
default:
break;
}
}
else
Expand Down
42 changes: 23 additions & 19 deletions arch/xtensa/src/esp32/esp32_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ static void esp32_idlepm(void)
/* Keep working in normal stage */

pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);

/* Release the stay above: it only forces this one state change. */

pm_relax(PM_IDLE_DOMAIN, PM_NORMAL);
newstate = PM_NORMAL;
}

Expand Down Expand Up @@ -174,31 +178,31 @@ static void esp32_idlepm(void)

switch (newstate)
{
case PM_NORMAL:
break;
case PM_NORMAL:
break;

case PM_IDLE:
break;
case PM_IDLE:
break;

case PM_STANDBY:
{
/* Enter Force-sleep mode */
case PM_STANDBY:
{
/* Enter Force-sleep mode */

esp_pmstandby(CONFIG_PM_ALARM_SEC * 1000000 +
CONFIG_PM_ALARM_NSEC / 1000);
}
break;
esp_pmstandby(CONFIG_PM_ALARM_SEC * 1000000 +
CONFIG_PM_ALARM_NSEC / 1000);
}
break;

case PM_SLEEP:
{
/* Enter Deep-sleep mode */
case PM_SLEEP:
{
/* Enter Deep-sleep mode */

esp_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}
esp_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}

default:
break;
default:
break;
}
}
else
Expand Down
42 changes: 23 additions & 19 deletions arch/xtensa/src/esp32s2/esp32s2_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ static void up_idlepm(void)
/* Keep working in normal stage */

pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);

/* Release the stay above: it only forces this one state change. */

pm_relax(PM_IDLE_DOMAIN, PM_NORMAL);
newstate = PM_NORMAL;
}

Expand Down Expand Up @@ -139,31 +143,31 @@ static void up_idlepm(void)

switch (newstate)
{
case PM_NORMAL:
break;
case PM_NORMAL:
break;

case PM_IDLE:
break;
case PM_IDLE:
break;

case PM_STANDBY:
{
/* Enter Force-sleep mode */
case PM_STANDBY:
{
/* Enter Force-sleep mode */

esp_pmstandby(CONFIG_PM_ALARM_SEC * 1000000 +
CONFIG_PM_ALARM_NSEC / 1000);
}
break;
esp_pmstandby(CONFIG_PM_ALARM_SEC * 1000000 +
CONFIG_PM_ALARM_NSEC / 1000);
}
break;

case PM_SLEEP:
{
/* Enter Deep-sleep mode */
case PM_SLEEP:
{
/* Enter Deep-sleep mode */

esp_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}
esp_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}

default:
break;
default:
break;
}
}
else
Expand Down
46 changes: 25 additions & 21 deletions arch/xtensa/src/esp32s3/esp32s3_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ static void up_idlepm(void)
/* Keep working in normal stage */

pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);

/* Release the stay above: it only forces this one state change. */

pm_relax(PM_IDLE_DOMAIN, PM_NORMAL);
newstate = PM_NORMAL;
}

Expand Down Expand Up @@ -139,31 +143,31 @@ static void up_idlepm(void)

switch (newstate)
{
case PM_NORMAL:
break;
case PM_NORMAL:
break;

case PM_IDLE:
break;
case PM_IDLE:
break;

case PM_STANDBY:
{
/* Enter Force-sleep mode */
case PM_STANDBY:
{
/* Enter Force-sleep mode */

esp_pmstandby(CONFIG_PM_ALARM_SEC * 1000000 +
CONFIG_PM_ALARM_NSEC / 1000);
}
break;
esp_pmstandby(CONFIG_PM_ALARM_SEC * 1000000 +
CONFIG_PM_ALARM_NSEC / 1000);
}
break;

case PM_SLEEP:
{
/* Enter Deep-sleep mode */
case PM_SLEEP:
{
/* Enter Deep-sleep mode */

esp_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}
esp_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}

default:
break;
default:
break;
}
}
else
Expand Down Expand Up @@ -228,9 +232,9 @@ void up_idle(void)
__asm__ __volatile__ ("waiti 0");
# endif

/* Perform IDLE mode power management */
/* Perform IDLE mode power management */

up_idlepm();
up_idlepm();
#endif /* CONFIG_SUPPRESS_INTERRUPTS || CONFIG_SUPPRESS_TIMER_INTS */

#ifdef CONFIG_ESP32S3_SPEED_UP_ISR
Expand Down
Loading