From a5fc945fd24ccac99b9a72721d70eabfd60bbd8a Mon Sep 17 00:00:00 2001 From: Ruibin Chang Date: Mon, 28 Mar 2022 16:29:50 +0800 Subject: [PATCH] ITE drivers/timer: check HW cycles per second by build assert ITE RTOS timer HW frequency is fixed at 32768Hz, because this clock source is always active in any EC mode (running/doze/deep doze). Signed-off-by: Ruibin Chang --- drivers/timer/ite_it8xxx2_timer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/timer/ite_it8xxx2_timer.c b/drivers/timer/ite_it8xxx2_timer.c index 3a3f392e7d3..160ad24a936 100644 --- a/drivers/timer/ite_it8xxx2_timer.c +++ b/drivers/timer/ite_it8xxx2_timer.c @@ -15,6 +15,9 @@ #include LOG_MODULE_REGISTER(timer, LOG_LEVEL_ERR); +BUILD_ASSERT(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 32768, + "ITE RTOS timer HW frequency is fixed at 32768Hz"); + /* Event timer configurations */ #define EVENT_TIMER EXT_TIMER_3 #define EVENT_TIMER_IRQ DT_INST_IRQ_BY_IDX(0, 0, irq)