pm: add lock for pm_auto_updatestate_cb()

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2023-01-16 21:29:36 +08:00 committed by Xiang Xiao
parent 43d2c595b1
commit d2ef505684

View File

@ -42,9 +42,14 @@ static void pm_auto_updatestate_cb(FAR void *arg)
{
int domain = (uintptr_t)arg;
enum pm_state_e newstate;
irqstate_t flags;
flags = pm_lock(domain);
newstate = pm_checkstate(domain);
pm_changestate(domain, newstate);
pm_unlock(domain, flags);
}
/****************************************************************************