From ad105614bc3ffbc384ffe056e7ed4f01118a4ae4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 2 Sep 2023 15:21:34 +1000 Subject: [PATCH] AP_Camera: allow more libraries to compile with no HAL_GCS_ENABLED --- libraries/AP_Camera/AP_Camera_Backend.cpp | 2 +- libraries/AP_Camera/AP_Camera_config.h | 3 ++- libraries/AP_Camera/AP_RunCam.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Camera/AP_Camera_Backend.cpp b/libraries/AP_Camera/AP_Camera_Backend.cpp index 7fd7bd261d..8e3b88bba7 100644 --- a/libraries/AP_Camera/AP_Camera_Backend.cpp +++ b/libraries/AP_Camera/AP_Camera_Backend.cpp @@ -318,7 +318,7 @@ void AP_Camera_Backend::prep_mavlink_msg_camera_feedback(uint64_t timestamp_us) camera_feedback.yaw_sensor = ahrs.yaw_sensor; camera_feedback.feedback_trigger_logged_count = feedback_trigger_logged_count; - gcs().send_message(MSG_CAMERA_FEEDBACK); + GCS_SEND_MESSAGE(MSG_CAMERA_FEEDBACK); } // log picture diff --git a/libraries/AP_Camera/AP_Camera_config.h b/libraries/AP_Camera/AP_Camera_config.h index c07645112a..565c344f31 100644 --- a/libraries/AP_Camera/AP_Camera_config.h +++ b/libraries/AP_Camera/AP_Camera_config.h @@ -3,6 +3,7 @@ #include #include #include +#include #ifndef AP_CAMERA_ENABLED #define AP_CAMERA_ENABLED 1 @@ -13,7 +14,7 @@ #endif #ifndef AP_CAMERA_MAVLINK_ENABLED -#define AP_CAMERA_MAVLINK_ENABLED AP_CAMERA_BACKEND_DEFAULT_ENABLED +#define AP_CAMERA_MAVLINK_ENABLED AP_CAMERA_BACKEND_DEFAULT_ENABLED && HAL_GCS_ENABLED #endif #ifndef AP_CAMERA_MAVLINKCAMV2_ENABLED diff --git a/libraries/AP_Camera/AP_RunCam.cpp b/libraries/AP_Camera/AP_RunCam.cpp index c86b9d9a7f..4c9124b642 100644 --- a/libraries/AP_Camera/AP_RunCam.cpp +++ b/libraries/AP_Camera/AP_RunCam.cpp @@ -958,11 +958,11 @@ void AP_RunCam::parse_device_info(const Request& request) } if (_features > 0) { _state = State::INITIALIZED; - gcs().send_text(MAV_SEVERITY_INFO, "RunCam initialized, features 0x%04X, %d-key OSD\n", _features.get(), + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "RunCam initialized, features 0x%04X, %d-key OSD\n", _features.get(), has_5_key_OSD() ? 5 : has_2_key_OSD() ? 2 : 0); } else { // nothing as as nothing does - gcs().send_text(MAV_SEVERITY_WARNING, "RunCam device not found\n"); + GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "RunCam device not found\n"); } debug("RunCam: initialized state: video: %d, osd: %d, cam: %d\n", int(_video_recording), int(_osd_option), int(_cam_control_option)); }