From 2e8f0a47ff92f4a62ab9e13eca9023ae2d60d547 Mon Sep 17 00:00:00 2001 From: jincheng Date: Thu, 23 Sep 2021 10:02:12 +0800 Subject: [PATCH] fix wrong clock_id in function `time_now_us` Close https://github.com/espressif/esp-idf/issues/7561 --- .../bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c index 5f987dbb32..1119fdde43 100644 --- a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c +++ b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c @@ -397,7 +397,7 @@ static UINT64 time_now_us(void) { #if _POSIX_TIMERS struct timespec ts_now; - clock_gettime(CLOCK_BOOTTIME, &ts_now); + clock_gettime(CLOCK_MONOTONIC, &ts_now); return ((UINT64)ts_now.tv_sec * 1000000L) + ((UINT64)ts_now.tv_nsec / 1000); #else struct timeval ts_now;