AP_ADSB: allow for compilation without AP_RTC_ENABLED

This commit is contained in:
Peter Barker authored and Andrew Tridgell committed 2023-10-11 19:17:27 +11:00
1 parent 68f74f9fc4
commit fdcd13746d
2 files changed
+8

No files matched your search

+4
View File
@@ -514,6 +514,7 @@ void AP_ADSB_Sagetech::send_msg_GPS()
hemisphere |= (AP::gps().status() < AP_GPS::GPS_OK_FIX_2D) ? 0x80 : 0; // isInvalid
pkt.payload[35] = hemisphere;
#if AP_RTC_ENABLED
// time
uint64_t time_usec;
if (AP::rtc().get_utc_usec(time_usec)) {
@@ -526,6 +527,9 @@ void AP_ADSB_Sagetech::send_msg_GPS()
} else {
memset(&pkt.payload[36],' ', 10);
}
#else
memset(&pkt.payload[36],' ', 10);
#endif
send_msg(pkt);
}
@@ -681,6 +681,7 @@ void AP_ADSB_Sagetech_MXS::send_gps_msg()
gps.gpsValid = (AP::gps().status() < AP_GPS::GPS_OK_FIX_2D) ? false : true; // If the status is not OK, gpsValid is false.
#if AP_RTC_ENABLED
uint64_t time_usec;
if (AP::rtc().get_utc_usec(time_usec)) {
const time_t time_sec = time_usec * 1E-6;
@@ -690,6 +691,9 @@ void AP_ADSB_Sagetech_MXS::send_gps_msg()
} else {
strncpy(gps.timeOfFix, " . ", 11);
}
#else
strncpy(gps.timeOfFix, " . ", 11);
#endif
int32_t height;
if (_frontend._my_loc.initialised() && _frontend._my_loc.get_alt_cm(Location::AltFrame::ABOVE_TERRAIN, height)) {