esp32_c3/pm: Fix assert issue in PM mode

1. Adjust code to avoid PM wakelock->count less than or equal to 0.
    2. Fix some document format issues.

Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
This commit is contained in:
chenwen@espressif.com 2024-04-10 19:55:58 +08:00 committed by Xiang Xiao
parent 6e941aed8b
commit 3a9d163aae
5 changed files with 6 additions and 19 deletions

View File

@ -329,7 +329,7 @@ pm
-------
This config demonstrate the use of power management present on the ESP32-S3.
You can use the pmconfig command to test the power management.
You can use the ``pmconfig`` command to test the power management.
Enables PM support. You can define standby mode and sleep mode delay time::
$ make menuconfig
@ -340,6 +340,7 @@ Enables PM support. You can define standby mode and sleep mode delay time::
(0) PM_SLEEP delay (nanoseconds)
Before switching PM status, you need to query the current PM status::
nsh> pmconfig
Last state 0, Next state 0
@ -369,12 +370,13 @@ System switch to the PM standby mode, you need to enter::
nsh> pmconfig relax normal
System switch to the PM sleep mode, you need to enter::
nsh> pmconfig relax standby
nsh> pmconfig relax idle
nsh> pmconfig relax normal
nsh> pmconfig relax normal
Note: when normal mode COUNT is 0, it will switch to the next PM state where COUNT is not 0.
Note: When normal mode COUNT is 0, it will switch to the next PM state where COUNT is not 0.
psram_quad
----------

View File

@ -200,7 +200,6 @@ static void up_idlepm(void)
esp32c3_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}
break;
default:
break;
@ -208,13 +207,6 @@ static void up_idlepm(void)
}
else
{
if (oldstate == PM_NORMAL)
{
/* Relax normal operation */
pm_relax(PM_IDLE_DOMAIN, PM_NORMAL);
}
#ifdef CONFIG_WATCHDOG
/* Announce the power management state change to feed watchdog */

View File

@ -219,7 +219,6 @@ static void esp32_idlepm(void)
esp32_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}
break;
default:
break;
@ -227,13 +226,6 @@ static void esp32_idlepm(void)
}
else
{
if (oldstate == PM_NORMAL)
{
/* Relax normal operation */
pm_relax(PM_IDLE_DOMAIN, PM_NORMAL);
}
#ifdef CONFIG_WATCHDOG
/* Announce the power management state change to feed watchdog */

View File

@ -140,7 +140,6 @@ static void up_idlepm(void)
esp32s3_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 +
CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000);
}
break;
default:
break;

View File

@ -21,6 +21,7 @@ CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_ESP32_UART0=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_IDLETHREAD_STACKSIZE=3072
@ -36,6 +37,7 @@ CONFIG_NSH_READLINE=y
CONFIG_PM=y
CONFIG_PM_GOVERNOR_EXPLICIT_RELAX=-1
CONFIG_PM_GOVERNOR_GREEDY=y
CONFIG_PM_PROCFS=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000