diff --git a/libraries/AP_Mount/AP_Mount_Viewpro.cpp b/libraries/AP_Mount/AP_Mount_Viewpro.cpp index 3b03d7c8a5..07608d689b 100644 --- a/libraries/AP_Mount/AP_Mount_Viewpro.cpp +++ b/libraries/AP_Mount/AP_Mount_Viewpro.cpp @@ -668,6 +668,7 @@ bool AP_Mount_Viewpro::send_m_ahrs() return false; } +#if AP_RTC_ENABLED // get date and time uint16_t year, ms; uint8_t month, day, hour, min, sec; @@ -676,6 +677,10 @@ bool AP_Mount_Viewpro::send_m_ahrs() } uint16_t date = ((year-2000) & 0x7f) | (((month+1) & 0x0F) << 7) | ((day & 0x1F) << 11); uint64_t second_hundredths = (((hour * 60 * 60) + (min * 60) + sec) * 100) + (ms * 0.1); +#else + const uint16_t date = 0; + const uint64_t second_hundredths = 0; +#endif // get vehicle velocity in m/s in NED Frame Vector3f vel_NED; diff --git a/libraries/AP_Mount/AP_Mount_Xacti.cpp b/libraries/AP_Mount/AP_Mount_Xacti.cpp index 695b65552d..9f210993d4 100644 --- a/libraries/AP_Mount/AP_Mount_Xacti.cpp +++ b/libraries/AP_Mount/AP_Mount_Xacti.cpp @@ -502,9 +502,14 @@ void AP_Mount_Xacti::handle_gnss_status_req(AP_DroneCAN* ap_dronecan, const Cana // get date and time uint16_t year, ms; uint8_t month, day, hour, min, sec; +#if AP_RTC_ENABLED if (!AP::rtc().get_date_and_time_utc(year, month, day, hour, min, sec, ms)) { year = month = day = hour = min = sec = 0; } +#else + year = month = day = hour = min = sec = 0; + (void)ms; +#endif // send xacti specific gnss status message com_xacti_GnssStatus xacti_gnss_status_msg {}; @@ -938,9 +943,14 @@ bool AP_Mount_Xacti::set_datetime(uint32_t now_ms) // get date and time uint16_t year, ms; uint8_t month, day, hour, min, sec; +#if AP_RTC_ENABLED if (!AP::rtc().get_date_and_time_utc(year, month, day, hour, min, sec, ms)) { return false; } +#else + (void)ms; + return false; +#endif // date time is of the format YYYYMMDDHHMMSS (14 bytes) // convert month from 0~11 to 1~12 range