From 71f77fea6ef1204ac338714bc5fe745cb312e3ac Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 2 Jun 2022 18:28:26 +1000 Subject: [PATCH] Rover: add and use AP_CAMERA_ENABLED --- Rover/Parameters.cpp | 2 +- Rover/Rover.cpp | 2 +- Rover/Rover.h | 2 +- Rover/config.h | 7 ------- Rover/system.cpp | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index e961ee9731..246bb9be1f 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -300,7 +300,7 @@ const AP_Param::Info Rover::var_info[] = { // @Path: ../libraries/AP_AHRS/AP_AHRS.cpp GOBJECT(ahrs, "AHRS_", AP_AHRS), -#if CAMERA == ENABLED +#if AP_CAMERA_ENABLED // @Group: CAM_ // @Path: ../libraries/AP_Camera/AP_Camera.cpp GOBJECT(camera, "CAM_", AP_Camera), diff --git a/Rover/Rover.cpp b/Rover/Rover.cpp index 54777c3701..e904322e91 100644 --- a/Rover/Rover.cpp +++ b/Rover/Rover.cpp @@ -104,7 +104,7 @@ const AP_Scheduler::Task Rover::scheduler_tasks[] = { #if HAL_MOUNT_ENABLED SCHED_TASK_CLASS(AP_Mount, &rover.camera_mount, update, 50, 200, 75), #endif -#if CAMERA == ENABLED +#if AP_CAMERA_ENABLED SCHED_TASK_CLASS(AP_Camera, &rover.camera, update, 50, 200, 78), #endif SCHED_TASK(gcs_failsafe_check, 10, 200, 81), diff --git a/Rover/Rover.h b/Rover/Rover.h index 92cc9642dc..0c42456706 100644 --- a/Rover/Rover.h +++ b/Rover/Rover.h @@ -158,7 +158,7 @@ private: struct Location current_loc; // Camera -#if CAMERA == ENABLED +#if AP_CAMERA_ENABLED AP_Camera camera{MASK_LOG_CAMERA}; #endif diff --git a/Rover/config.h b/Rover/config.h index 48b4c9aa63..62959e9102 100644 --- a/Rover/config.h +++ b/Rover/config.h @@ -31,13 +31,6 @@ #error XXX #endif -////////////////////////////////////////////////////////////////////////////// -// CAMERA control -// -#ifndef CAMERA - #define CAMERA ENABLED -#endif - ////////////////////////////////////////////////////////////////////////////// // GRIPPER control // diff --git a/Rover/system.cpp b/Rover/system.cpp index 501b47719b..c77cafc4e5 100644 --- a/Rover/system.cpp +++ b/Rover/system.cpp @@ -234,7 +234,7 @@ bool Rover::set_mode(Mode &new_mode, ModeReason reason) fence.manual_recovery_start(); #endif -#if CAMERA == ENABLED +#if AP_CAMERA_ENABLED camera.set_is_auto_mode(control_mode->mode_number() == Mode::Number::AUTO); #endif