summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/timestamp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 0c9c884942..4b5f4d4b06 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -180,6 +180,9 @@ uint64_t __attribute__((weak)) timestamp_get(void)
{
struct mono_time t1, t2;
+ if (!IS_ENABLED(CONFIG_HAVE_MONOTONIC_TIMER))
+ return 0;
+
mono_time_set_usecs(&t1, 0);
timer_monotonic_get(&t2);