kernel: idle: fix builds with PM but no system clock
PM depends on SYS_CLOCK_EXISTS in Kconfig but several boards have Kconfig overrides that allow the dependency to be ignored, so CONFIG_PM=y even though CONFIG_SYS_CLOCK_EXISTS=n. Fix the code so that the true dependency is reflected in the generated code. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
187697c2d7
commit
19cb44bab7
1 changed files with 4 additions and 2 deletions
|
@ -189,7 +189,6 @@ void idle(void *p1, void *unused2, void *unused3)
|
||||||
* API we need to honor...
|
* API we need to honor...
|
||||||
*/
|
*/
|
||||||
z_set_timeout_expiry((ticks < IDLE_THRESH) ? 1 : ticks, true);
|
z_set_timeout_expiry((ticks < IDLE_THRESH) ? 1 : ticks, true);
|
||||||
#endif /* CONFIG_SYS_CLOCK_EXISTS */
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
_kernel.idle = ticks;
|
_kernel.idle = ticks;
|
||||||
/* Check power policy and decide if we are going to sleep or
|
/* Check power policy and decide if we are going to sleep or
|
||||||
|
@ -198,9 +197,12 @@ void idle(void *p1, void *unused2, void *unused3)
|
||||||
if (pm_save_idle(ticks) == POWER_STATE_ACTIVE) {
|
if (pm_save_idle(ticks) == POWER_STATE_ACTIVE) {
|
||||||
k_cpu_idle();
|
k_cpu_idle();
|
||||||
}
|
}
|
||||||
#else
|
#else /* CONFIG_PM */
|
||||||
k_cpu_idle();
|
k_cpu_idle();
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
#else /* CONFIG_SYS_CLOCK_EXISTS */
|
||||||
|
k_cpu_idle();
|
||||||
|
#endif /* CONFIG_SYS_CLOCK_EXISTS */
|
||||||
|
|
||||||
IDLE_YIELD_IF_COOP();
|
IDLE_YIELD_IF_COOP();
|
||||||
#endif /* SMP_FALLBACK */
|
#endif /* SMP_FALLBACK */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue