diff --git a/arch/sim/src/sim/up_idle.c b/arch/sim/src/sim/up_idle.c index 7e4a4d6208..71b764df56 100644 --- a/arch/sim/src/sim/up_idle.c +++ b/arch/sim/src/sim/up_idle.c @@ -59,9 +59,13 @@ void up_idle(void) #ifdef CONFIG_PM static enum pm_state_e state = PM_NORMAL; enum pm_state_e newstate; + irqstate_t flags; /* Fake some power management stuff for testing purposes */ + flags = enter_critical_section(); + sched_lock(); + newstate = pm_checkstate(PM_IDLE_DOMAIN); if (newstate != state) { @@ -78,4 +82,11 @@ void up_idle(void) up_timer_update(); #endif + +#ifdef CONFIG_PM + pm_changestate(PM_IDLE_DOMAIN, PM_RESTORE); + + sched_unlock(); + leave_critical_section(flags); +#endif }