Skip to content

Commit 110cd6b

Browse files
kernel: fix compilation with CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
Fix compilation with CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME=y and CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC unset at the board/SoC level. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
1 parent 895d911 commit 110cd6b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/zephyr/sys_clock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ typedef struct {
154154

155155
/** @endcond */
156156

157+
#ifndef CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
157158
#if defined(CONFIG_SYS_CLOCK_EXISTS) && \
158159
(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0)
159160
#error "SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!"
160161
#endif
161-
162+
#endif /* CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME */
162163

163164
/* kernel clocks */
164165

kernel/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ config SYS_CLOCK_TICKS_PER_SEC
813813

814814
config SYS_CLOCK_HW_CYCLES_PER_SEC
815815
int "System clock's h/w timer frequency"
816+
default 0 if TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
816817
help
817818
This option specifies the frequency of the hardware timer used for the
818819
system clock (in Hz). This option is set by the SOC's or board's Kconfig file

0 commit comments

Comments
 (0)