boards: spresense: Fix PMIC setting during boot-up

When RTC clock is still unstable, the continuous PMIC settings may not
be reflected. This commit adds a delay time to avoid such problem.
This commit is contained in:
SPRESENSE 2021-05-19 17:48:18 +09:00 committed by Alin Jerpelea
parent 76df958e34
commit 8403fe6503
1 changed files with 14 additions and 0 deletions

View File

@ -205,6 +205,13 @@ int board_power_control(int target, bool en)
if (pfunc)
{
ret = pfunc(PMIC_GET_CH(target), en);
/* If RTC clock is unstable, delay 1 tick for PMIC setting. */
if (!g_rtc_enabled)
{
usleep(1);
}
}
return ret;
@ -236,6 +243,13 @@ int board_power_control_tristate(int target, int value)
/* set HiZ to PMIC GPO channel */
ret = cxd56_pmic_set_gpo_hiz(PMIC_GET_CH(target));
/* If RTC clock is unstable, delay 1 tick for PMIC setting. */
if (!g_rtc_enabled)
{
usleep(1);
}
}
else
{