AP_Camera: add and use AP_CAMERA_SERVO_ENABLED

This commit is contained in:
Peter Barker 2023-03-07 10:04:45 +11:00 committed by Andrew Tridgell
parent dea34086ac
commit 86930592c4
5 changed files with 14 additions and 5 deletions

View File

@ -86,9 +86,12 @@ void AP_Camera::init()
CameraType camera_type = get_type(instance);
// check for servo camera
if (camera_type == CameraType::SERVO) {
if (false) {
#if AP_CAMERA_SERVO_ENABLED
} else if (camera_type == CameraType::SERVO) {
_backends[instance] = new AP_Camera_Servo(*this, _params[instance], instance);
_num_instances++;
#endif
#if AP_CAMERA_RELAY_ENABLED
// check for relay camera

View File

@ -47,7 +47,9 @@ public:
// enums
enum class CameraType {
NONE = 0, // None
#if AP_CAMERA_SERVO_ENABLED
SERVO = 1, // Servo/PWM controlled camera
#endif
#if AP_CAMERA_RELAY_ENABLED
RELAY = 2, // Relay controlled camera
#endif

View File

@ -1,6 +1,6 @@
#include "AP_Camera_Servo.h"
#if AP_CAMERA_ENABLED
#if AP_CAMERA_SERVO_ENABLED
#include <SRV_Channel/SRV_Channel.h>
@ -68,4 +68,4 @@ void AP_Camera_Servo::configure(float shooting_mode, float shutter_speed, float
}
}
#endif // AP_CAMERA_ENABLED
#endif // AP_CAMERA_SERVO_ENABLED

View File

@ -20,7 +20,7 @@
#include "AP_Camera_Backend.h"
#if AP_CAMERA_ENABLED
#if AP_CAMERA_SERVO_ENABLED
class AP_Camera_Servo : public AP_Camera_Backend
{
@ -47,4 +47,4 @@ private:
uint16_t iso_counter; // count of number of cycles iso output should be held open
};
#endif // AP_CAMERA_ENABLED
#endif // AP_CAMERA_SERVO_ENABLED

View File

@ -23,6 +23,10 @@
#define AP_CAMERA_RELAY_ENABLED AP_CAMERA_BACKEND_DEFAULT_ENABLED
#endif
#ifndef AP_CAMERA_SERVO_ENABLED
#define AP_CAMERA_SERVO_ENABLED AP_CAMERA_BACKEND_DEFAULT_ENABLED
#endif
#ifndef AP_CAMERA_SOLOGIMBAL_ENABLED
#define AP_CAMERA_SOLOGIMBAL_ENABLED AP_CAMERA_BACKEND_DEFAULT_ENABLED && HAL_SOLO_GIMBAL_ENABLED
#endif