AP_Mount: create and use AP_Mount_config.h

This commit is contained in:
Peter Barker 2023-03-06 09:42:54 +11:00 committed by Peter Barker
parent 6770982a98
commit 93cb56b5f2
9 changed files with 43 additions and 37 deletions

View File

@ -19,15 +19,7 @@
************************************************************/
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_MOUNT_ENABLED
#define HAL_MOUNT_ENABLED !HAL_MINIMIZE_FEATURES
#endif
#ifndef HAL_SOLO_GIMBAL_ENABLED
#define HAL_SOLO_GIMBAL_ENABLED 0
#endif
#include "AP_Mount_config.h"
#if HAL_MOUNT_ENABLED

View File

@ -5,10 +5,6 @@
#include "AP_Mount_Backend.h"
#ifndef HAL_MOUNT_ALEXMOS_ENABLED
#define HAL_MOUNT_ALEXMOS_ENABLED HAL_MOUNT_ENABLED
#endif
#if HAL_MOUNT_ALEXMOS_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h>

View File

@ -5,10 +5,6 @@
#include "AP_Mount_Backend.h"
#ifndef HAL_MOUNT_GREMSY_ENABLED
#define HAL_MOUNT_GREMSY_ENABLED (HAL_MOUNT_ENABLED && !HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024)
#endif
#if HAL_MOUNT_GREMSY_ENABLED
#include <AP_Math/AP_Math.h>

View File

@ -5,10 +5,6 @@
#include "AP_Mount_Backend.h"
#ifndef HAL_MOUNT_STORM32MAVLINK_ENABLED
#define HAL_MOUNT_STORM32MAVLINK_ENABLED HAL_MOUNT_ENABLED
#endif
#if HAL_MOUNT_STORM32MAVLINK_ENABLED
#include <AP_Math/AP_Math.h>

View File

@ -5,10 +5,6 @@
#include "AP_Mount_Backend.h"
#ifndef HAL_MOUNT_STORM32SERIAL_ENABLED
#define HAL_MOUNT_STORM32SERIAL_ENABLED HAL_MOUNT_ENABLED
#endif
#if HAL_MOUNT_STORM32SERIAL_ENABLED
#include <AP_HAL/AP_HAL.h>

View File

@ -6,10 +6,6 @@
#include "AP_Mount_Backend.h"
#ifndef HAL_MOUNT_SCRIPTING_ENABLED
#define HAL_MOUNT_SCRIPTING_ENABLED HAL_MOUNT_ENABLED && AP_SCRIPTING_ENABLED
#endif
#if HAL_MOUNT_SCRIPTING_ENABLED
#include <AP_HAL/AP_HAL.h>

View File

@ -5,10 +5,6 @@
#include "AP_Mount_Backend.h"
#ifndef HAL_MOUNT_SERVO_ENABLED
#define HAL_MOUNT_SERVO_ENABLED HAL_MOUNT_ENABLED
#endif
#if HAL_MOUNT_SERVO_ENABLED
#include <AP_Math/AP_Math.h>

View File

@ -21,10 +21,6 @@
#include "AP_Mount_Backend.h"
#ifndef HAL_MOUNT_SIYI_ENABLED
#define HAL_MOUNT_SIYI_ENABLED HAL_MOUNT_ENABLED
#endif
#if HAL_MOUNT_SIYI_ENABLED
#include <AP_HAL/AP_HAL.h>

View File

@ -0,0 +1,42 @@
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_MOUNT_ENABLED
#define HAL_MOUNT_ENABLED !HAL_MINIMIZE_FEATURES
#endif
#define AP_MOUNT_BACKEND_DEFAULT_ENABLED HAL_MOUNT_ENABLED
#ifndef HAL_MOUNT_ALEXMOS_ENABLED
#define HAL_MOUNT_ALEXMOS_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED
#endif
#ifndef HAL_MOUNT_GREMSY_ENABLED
#define HAL_MOUNT_GREMSY_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED && (!HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024)
#endif
#ifndef HAL_MOUNT_SCRIPTING_ENABLED
#define HAL_MOUNT_SCRIPTING_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED && AP_SCRIPTING_ENABLED
#endif
#ifndef HAL_MOUNT_SERVO_ENABLED
#define HAL_MOUNT_SERVO_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED
#endif
#ifndef HAL_MOUNT_SIYI_ENABLED
#define HAL_MOUNT_SIYI_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED
#endif
// solo gimbal is enabled explicitly in hwdefs on some Cubes:
#ifndef HAL_SOLO_GIMBAL_ENABLED
#define HAL_SOLO_GIMBAL_ENABLED 0
#endif
#ifndef HAL_MOUNT_STORM32MAVLINK_ENABLED
#define HAL_MOUNT_STORM32MAVLINK_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED
#endif
#ifndef HAL_MOUNT_STORM32SERIAL_ENABLED
#define HAL_MOUNT_STORM32SERIAL_ENABLED AP_MOUNT_BACKEND_DEFAULT_ENABLED
#endif