Commit 110cd6b8 authored by Henrik Brix Andersen's avatar Henrik Brix Andersen
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: default avatarHenrik Brix Andersen <henrik@brixandersen.dk>
parent 895d9116
Loading
Loading
Loading
Loading
+2 −1
Changes for include/zephyr/sys_clock.h: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -154,11 +154,12 @@ typedef struct {

/** @endcond */

#ifndef CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
#if defined(CONFIG_SYS_CLOCK_EXISTS) && \
	(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0)
#error "SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!"
#endif

#endif /* CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME */

/* kernel clocks */

+1 −0
Changes for kernel/Kconfig: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -813,6 +813,7 @@ config SYS_CLOCK_TICKS_PER_SEC

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