arch/arm/src/stm32l4/stm32l4_idle.c: (1) Added BEGIN_IDLE()/END_IDLE() to stop call so that we also get notification via LED of the STOP mode, (2) Added the stm32l4_clockenable call as previously discussed, and (3) Added call to pm_changestate() to inform drivers we're back to running after the call to stm32l4_stop() returns.

This commit is contained in:
Matias N 2019-11-08 17:00:16 -06:00 committed by Gregory Nutt
parent b6756eb5fe
commit 93e11dacb8

View File

@ -48,6 +48,7 @@
#include "chip.h"
#include "stm32l4_pm.h"
#include "stm32l4_rcc.h"
#include "up_internal.h"
/****************************************************************************
@ -129,7 +130,25 @@ static void up_idlepm(void)
break;
case PM_STANDBY:
/* Enter STOP mode */
BEGIN_IDLE();
stm32l4_pmstop(true);
END_IDLE();
/* Set correct clock again after returning from STOP */
stm32l4_clockenable();
/* Inform of all drivers of the new state */
ret = pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);
if (ret >= 0)
{
oldstate = PM_NORMAL;
}
break;
case PM_SLEEP: