diff --git a/libraries/AP_Terrain/AP_Terrain.cpp b/libraries/AP_Terrain/AP_Terrain.cpp index 2c50a825eb..deb98ae733 100644 --- a/libraries/AP_Terrain/AP_Terrain.cpp +++ b/libraries/AP_Terrain/AP_Terrain.cpp @@ -345,8 +345,10 @@ void AP_Terrain::update(void) // check for pending mission data update_mission_data(); +#if HAL_RALLY_ENABLED // check for pending rally data update_rally_data(); +#endif // update tiles surrounding our current location: if (pos_valid) { diff --git a/libraries/AP_Terrain/TerrainMission.cpp b/libraries/AP_Terrain/TerrainMission.cpp index 381bc6bc55..ec39b6eca7 100644 --- a/libraries/AP_Terrain/TerrainMission.cpp +++ b/libraries/AP_Terrain/TerrainMission.cpp @@ -115,6 +115,7 @@ void AP_Terrain::update_mission_data(void) #endif // AP_MISSION_ENABLED } +#if HAL_RALLY_ENABLED /* check that we have fetched all rally terrain data */ @@ -171,5 +172,6 @@ void AP_Terrain::update_rally_data(void) next_rally_index++; } } +#endif #endif // AP_TERRAIN_AVAILABLE