Skip to content

Commit

Permalink
kernel: idle: fix build error on arm-clang
Browse files Browse the repository at this point in the history
When building sample.minimal.mt-no-preempt-no-timers.arm on arm-clang
we get a link error as z_pm_save_idle_exit expects sys_clock_idle_exit
to be defined.

However the sample sets CONFIG_SYS_CLOCK_EXISTS=n so
sys_clock_idle_exit() will not be defined by any driver.  So add proper
ifdef protection in z_pm_save_idle_exit to fix this.

Signed-off-by: Kumar Gala <[email protected]>
  • Loading branch information
galak committed May 2, 2023
1 parent f9fbd8a commit 96a9055
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ void z_pm_save_idle_exit(void)
*/
pm_system_resume();
#endif /* CONFIG_PM */
#ifdef CONFIG_SYS_CLOCK_EXISTS
sys_clock_idle_exit();
#endif
}

void idle(void *unused1, void *unused2, void *unused3)
Expand Down

0 comments on commit 96a9055

Please sign in to comment.