From 23f5fcffb2a2ace9b51ea6ac203f9c69962f6555 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 4 Oct 2023 18:03:33 +1100 Subject: [PATCH] AP_Stats: add and use an AP_RTC_config.h --- libraries/AP_Stats/AP_Stats.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_Stats/AP_Stats.cpp b/libraries/AP_Stats/AP_Stats.cpp index 9c82a0e32e..13992983a4 100644 --- a/libraries/AP_Stats/AP_Stats.cpp +++ b/libraries/AP_Stats/AP_Stats.cpp @@ -108,6 +108,7 @@ void AP_Stats::update() params.flttime.set_and_save_ifchanged(0); params.runtime.set_and_save_ifchanged(0); uint32_t system_clock = 0; // in seconds +#if AP_RTC_ENABLED uint64_t rtc_clock_us; if (AP::rtc().get_utc_usec(rtc_clock_us)) { system_clock = rtc_clock_us / 1000000; @@ -115,6 +116,7 @@ void AP_Stats::update() // time base to Jan 1st 2016: system_clock -= 1451606400; } +#endif params.reset.set_and_save_ifchanged(system_clock); copy_variables_from_parameters(); }