diff --git a/libraries/AP_HAL/Util.cpp b/libraries/AP_HAL/Util.cpp index d93f9e4481..88a34d2fdf 100644 --- a/libraries/AP_HAL/Util.cpp +++ b/libraries/AP_HAL/Util.cpp @@ -101,6 +101,11 @@ void AP_HAL::Util::get_system_clock_utc(int32_t &hour, int32_t &min, int32_t &se hour = hour_ms / (60 * 60 * 1000); } +bool AP_HAL::Util::system_time_was_set() const +{ + return _system_time_was_set; +} + // get milliseconds from now to a target time of day expressed as hour, min, sec, ms // match starts from first value that is not -1. I.e. specifying hour=-1, minutes=10 will ignore the hour and return time until 10 minutes past 12am (utc) uint32_t AP_HAL::Util::get_time_utc(int32_t hour, int32_t min, int32_t sec, int32_t ms) const diff --git a/libraries/AP_HAL/Util.h b/libraries/AP_HAL/Util.h index f5073e3523..62196bc511 100644 --- a/libraries/AP_HAL/Util.h +++ b/libraries/AP_HAL/Util.h @@ -45,6 +45,11 @@ public: */ virtual void set_system_clock(uint64_t time_utc_usec) {} + /* + check if system clock was already set + */ + bool system_time_was_set() const; + /* get system clock in UTC milliseconds */