From 57d55dcc7a61a9f950c14d0f66ec7c2969dacf2c Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Tue, 4 Oct 2016 16:58:08 -0400 Subject: [PATCH] unified: have __ticks_to_ms() return 0 when no system clock Change-Id: I0834dfff2a631ef365be7ae3a55d5ad4ace3dbf5 Signed-off-by: Benjamin Walsh --- include/kernel.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/kernel.h b/include/kernel.h index 35d2837bd0d..ba7600ca4fc 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -240,7 +240,12 @@ extern void *k_thread_custom_data_get(void); static int64_t __ticks_to_ms(int64_t ticks) { +#if CONFIG_SYS_CLOCK_EXISTS return (MSEC_PER_SEC * (uint64_t)ticks) / sys_clock_ticks_per_sec; +#else + __ASSERT(ticks == 0, ""); + return 0; +#endif }