From 8fb1f6f02c0ee03a9203c8152185142222e1ff53 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 3 Jan 2024 11:59:44 +1100 Subject: [PATCH] AP_Camera: correct compilation when AP_CAMERA_RELAY_ENABLED is 0 ... like on skyviper-v2450 --- libraries/AP_Camera/AP_Camera.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_Camera/AP_Camera.cpp b/libraries/AP_Camera/AP_Camera.cpp index 76f3524e22..d16d29e441 100644 --- a/libraries/AP_Camera/AP_Camera.cpp +++ b/libraries/AP_Camera/AP_Camera.cpp @@ -781,11 +781,13 @@ bool AP_Camera::get_legacy_relay_index(int8_t &index) const // Copter, Plane, Sub and Rover all have both relay and camera and all init relay first // This will only be a issue if the relay and camera conversion were done at once, if the user skipped 4.4 for (uint8_t i = 0; i < AP_CAMERA_MAX_INSTANCES; i++) { +#if AP_CAMERA_RELAY_ENABLED if ((CameraType)_params[i].type.get() == CameraType::RELAY) { // Camera was hard coded to relay 0 index = 0; return true; } +#endif } return false; }