From f8339fc1bdb58c948e62c02eb4d30c11758c89ca Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 20 Jul 2017 10:14:07 +1000 Subject: [PATCH] newlib: Avoid deprecation warning calling system_get_time() from system_relative_time() --- components/newlib/time.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/newlib/time.c b/components/newlib/time.c index 1655c0b8e..c6a1e7024 100644 --- a/components/newlib/time.c +++ b/components/newlib/time.c @@ -229,7 +229,11 @@ uint32_t system_get_current_time(void) __attribute__((alias("system_get_time"))) uint32_t system_relative_time(uint32_t current_time) { - return system_get_time() - current_time; +#if defined( WITH_FRC1 ) || defined( WITH_RTC ) + return get_time_since_boot() - current_time; +#else + return 0; +#endif } uint64_t system_get_rtc_time(void)