mirror of
https://github.com/apache/nuttx.git
synced 2025-12-17 10:16:49 +08:00
arch/xtensa/esp32[-|-s3]: Fix exception issue when pm active
Fix exception issue when PM and DEBUG_ASSERTIONS enabled for esp32 and esp32s3. This error happens due to PM system workflow, when system gets into sleep-modes with removing PM_NORMAL count, system is raising an exception for not having enough number of PM_NORMAL state count if DEBUG_ASSERTIONS enabled. Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
This commit is contained in:
committed by
Matteo Golin
parent
aa8fb9ae2e
commit
734068890a
@@ -167,6 +167,18 @@ static void esp32_idlepm(void)
|
||||
static enum pm_state_e oldstate = PM_NORMAL;
|
||||
enum pm_state_e newstate;
|
||||
int ret;
|
||||
int count;
|
||||
|
||||
count = pm_staycount(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
if (oldstate != PM_NORMAL && count == 0)
|
||||
{
|
||||
pm_stay(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
|
||||
/* Keep working in normal stage */
|
||||
|
||||
pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
newstate = PM_NORMAL;
|
||||
}
|
||||
|
||||
/* Decide, which power saving level can be obtained */
|
||||
|
||||
|
||||
@@ -90,6 +90,18 @@ static void up_idlepm(void)
|
||||
static enum pm_state_e oldstate = PM_NORMAL;
|
||||
enum pm_state_e newstate;
|
||||
int ret;
|
||||
int count;
|
||||
|
||||
count = pm_staycount(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
if (oldstate != PM_NORMAL && count == 0)
|
||||
{
|
||||
pm_stay(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
|
||||
/* Keep working in normal stage */
|
||||
|
||||
pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
newstate = PM_NORMAL;
|
||||
}
|
||||
|
||||
/* Decide, which power saving level can be obtained */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user