Skip to content

Commit acba365

Browse files
carlescufirlubos
authored andcommitted
[nrf fromtree] include: sys_clock: Fix compilation when SYS_CLOCK_EXISTS is disabled
If `CONFIG_SYS_CLOCK_EXISTS=n`, then `CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC` will likely not be defined at all. Fix the compilation by moving the check for it being `== 0` to a separate preprocessor #if statement. Signed-off-by: Carles Cufi <[email protected]> (cherry picked from commit 03f46db)
1 parent 2ef0001 commit acba365

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/zephyr/sys_clock.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,11 @@ typedef struct {
162162
/** @endcond */
163163

164164
#ifndef CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
165-
#if defined(CONFIG_SYS_CLOCK_EXISTS) && \
166-
(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0)
165+
#if defined(CONFIG_SYS_CLOCK_EXISTS)
166+
#if CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0
167167
#error "SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!"
168-
#endif
168+
#endif /* CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0 */
169+
#endif /* CONFIG_SYS_CLOCK_EXISTS */
169170
#endif /* CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME */
170171

171172
/* kernel clocks */

0 commit comments

Comments
 (0)