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(); }