diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.cpp b/libraries/AP_BoardConfig/AP_BoardConfig.cpp index 416b3692ee..aadf834b2f 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.cpp +++ b/libraries/AP_BoardConfig/AP_BoardConfig.cpp @@ -21,6 +21,7 @@ #include #include "AP_BoardConfig.h" #include +#include #if HAL_WITH_UAVCAN #include @@ -227,6 +228,8 @@ void AP_BoardConfig::init() // rebooting hal.util->set_imu_target_temp((int8_t *)&_imu_target_temperature); #endif + + AP::rtc().set_utc_usec(hal.util->get_hw_rtc(), AP_RTC::SOURCE_HW); } // set default value for BRD_SAFETY_MASK diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.h b/libraries/AP_BoardConfig/AP_BoardConfig.h index 21d35055ca..2955a25e1e 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.h +++ b/libraries/AP_BoardConfig/AP_BoardConfig.h @@ -3,6 +3,7 @@ #include #include #include +#include #if defined(HAL_NEEDS_PARAM_HELPER) #include @@ -214,4 +215,7 @@ private: // HAL specific parameters AP_Param_Helper param_helper{false}; #endif + + // real-time-clock; private because access is via the singleton + AP_RTC rtc; };