AP_Camera: allow more libraries to compile with no HAL_GCS_ENABLED

This commit is contained in:
Peter Barker 2023-09-02 15:21:34 +10:00 committed by Peter Barker
parent 498fc97bae
commit ad105614bc
3 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -3,6 +3,7 @@
#include <AP_HAL/AP_HAL_Boards.h>
#include <AP_Mount/AP_Mount_config.h>
#include <AP_Relay/AP_Relay_config.h>
#include <GCS_MAVLink/GCS_config.h>
#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

View File

@ -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));
}