sys_clock: add option for setting timer frequency at runtime

Some timer devices, such as the HPET, read their frequencies at runtime.
All global constant values must be set at runtime in that case.

Change-Id: I408babce6deb857748a87691132d7e27e88f0bb8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2015-11-20 16:26:25 -05:00 committed by Anas Nashif
commit fde6458f0b
3 changed files with 18 additions and 1 deletions

View file

@ -35,7 +35,12 @@
#endif
#define sys_clock_ticks_per_sec CONFIG_SYS_CLOCK_TICKS_PER_SEC
#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
extern int sys_clock_hw_cycles_per_sec;
#else
#define sys_clock_hw_cycles_per_sec CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
#endif
/*
* sys_clock_us_per_tick global variable represents a number