]> granicus.if.org Git - esp-idf/commitdiff
newlib: Avoid deprecation warning calling system_get_time() from system_relative_time()
authorAngus Gratton <angus@espressif.com>
Thu, 20 Jul 2017 00:14:07 +0000 (10:14 +1000)
committerAngus Gratton <gus@projectgus.com>
Thu, 7 Sep 2017 06:32:05 +0000 (16:32 +1000)
components/newlib/time.c

index 1655c0b8e635e63184108ff013466b7c8a0b69b3..c6a1e702471bf9631e64040eb2c0570e5a1ca0be 100644 (file)
@@ -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)