Skip to content

Commit a455ba4

Browse files
committed
AP_GPS: correct compilation when blended not compiled in
1 parent 1951e3a commit a455ba4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libraries/AP_GPS/AP_GPS.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,16 +1009,18 @@ void AP_GPS::update_instance(uint8_t instance)
10091009
}
10101010

10111011
#if HAL_LOGGING_ENABLED
1012+
#if AP_GPS_BLENDED_ENABLED
10121013
if (type == GPS_TYPE_BLENDED) {
10131014
// Blended backend does its own logging:
10141015
data_should_be_logged = false;
10151016
}
1017+
#endif // AP_GPS_BLENDED_ENABLED
10161018
if (data_should_be_logged && should_log()) {
10171019
Write_GPS(instance);
10181020
}
1019-
#else
1020-
(void)data_should_be_logged;
10211021
#endif
1022+
// sometimes we don't do anything with data_should_be_logged
1023+
(void)data_should_be_logged;
10221024

10231025
#if AP_RTC_ENABLED
10241026
if (state[instance].status >= GPS_OK_FIX_3D) {
@@ -1922,13 +1924,15 @@ bool AP_GPS::pre_arm_checks(char failure_msg[], uint16_t failure_msg_len)
19221924
if (_auto_switch == 2) {
19231925
// ensure there is a blended backend
19241926
bool found = false;
1927+
#if AP_GPS_BLENDED_ENABLED
19251928
for (uint8_t i=0; i<GPS_MAX_INSTANCES; i++) {
19261929
// only care about configured type, not allocated type:
19271930
if (get_type(i) == GPS_TYPE_BLENDED) {
19281931
found = true;
19291932
break;
19301933
}
19311934
}
1935+
#endif // AP_GPS_BLENDED_ENABLED
19321936
if (!found) {
19331937
hal.util->snprintf(failure_msg, failure_msg_len, "GPS_AUTO_SWITCH is blended but no blended backend configured");
19341938
return false;

0 commit comments

Comments
 (0)