AP_RangeFinder: populate AP_RangeFinder_config.h

This commit is contained in:
Peter Barker 2023-06-24 11:09:28 +10:00 committed by Peter Barker
parent 5cbb776951
commit e26f8c1d11
7 changed files with 52 additions and 49 deletions

View File

@ -1,19 +1,11 @@
#pragma once
#include "AP_RangeFinder.h"
#include "AP_RangeFinder_Backend.h"
#include <AP_BoardConfig/AP_BoardConfig.h>
#ifndef AP_RANGEFINDER_BBB_PRU_ENABLED
#define AP_RANGEFINDER_BBB_PRU_ENABLED ( \
AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED && \
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI \
)
#endif
#include "AP_RangeFinder_config.h"
#if AP_RANGEFINDER_BBB_PRU_ENABLED
#include "AP_RangeFinder_Backend.h"
#define PRU0_CTRL_BASE 0x4a322000
#define PRU0_IRAM_BASE 0x4a334000
@ -54,4 +46,4 @@ private:
};
#endif
#endif // AP_RANGEFINDER_BBB_PRU_ENABLED

View File

@ -1,10 +1,6 @@
#pragma once
#include "AP_RangeFinder.h"
#ifndef AP_RANGEFINDER_BLPING_ENABLED
#define AP_RANGEFINDER_BLPING_ENABLED AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED
#endif
#include "AP_RangeFinder_config.h"
#if AP_RANGEFINDER_BLPING_ENABLED

View File

@ -14,19 +14,7 @@
*/
#pragma once
#include "AP_RangeFinder.h"
#include "AP_RangeFinder_Backend.h"
#include <AP_HAL/AP_HAL.h>
#include <utility>
#ifndef AP_RANGEFINDER_BEBOP_ENABLED
#define AP_RANGEFINDER_BEBOP_ENABLED \
AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED && \
(CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP || \
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO) && \
defined(HAVE_LIBIIO)
#endif
#include "AP_RangeFinder_config.h"
#if AP_RANGEFINDER_BEBOP_ENABLED
@ -158,4 +146,4 @@ private:
};
#endif
#endif // AP_RANGEFINDER_BEBOP_ENABLED

View File

@ -1,9 +1,10 @@
#pragma once
#include "AP_RangeFinder.h"
#include "AP_RangeFinder_Backend.h"
#include "AP_RangeFinder_config.h"
#if AP_SCRIPTING_ENABLED
#if AP_RANGEFINDER_LUA_ENABLED
#include "AP_RangeFinder_Backend.h"
// Data timeout
#define AP_RANGEFINDER_LUA_TIMEOUT_MS 500
@ -30,4 +31,4 @@ private:
float _distance_m; // stored data from lua script:
};
#endif
#endif // AP_RANGEFINDER_LUA_ENABLED

View File

@ -14,16 +14,12 @@
*/
#pragma once
#include <AP_BoardConfig/AP_BoardConfig.h>
#include "AP_RangeFinder_Backend.h"
#ifndef AP_RANGEFINDER_SIM_ENABLED
#define AP_RANGEFINDER_SIM_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL && AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED)
#endif
#include "AP_RangeFinder_config.h"
#if AP_RANGEFINDER_SIM_ENABLED
#include "AP_RangeFinder_Backend.h"
class AP_RangeFinder_SITL : public AP_RangeFinder_Backend {
public:
// constructor. This incorporates initialisation as well.

View File

@ -1,15 +1,13 @@
#pragma once
#include "AP_RangeFinder_config.h"
#if AP_RANGEFINDER_ANALOG_ENABLED
#include "AP_RangeFinder.h"
#include "AP_RangeFinder_Backend.h"
#include "AP_RangeFinder_Params.h"
#ifndef AP_RANGEFINDER_ANALOG_ENABLED
#define AP_RANGEFINDER_ANALOG_ENABLED AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED
#endif
#if AP_RANGEFINDER_ANALOG_ENABLED
class AP_RangeFinder_analog : public AP_RangeFinder_Backend
{
public:
@ -35,4 +33,4 @@ private:
AP_HAL::AnalogSource *source;
};
#endif
#endif // AP_RANGEFINDER_ANALOG_ENABLED

View File

@ -1,6 +1,7 @@
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#include <AP_Scripting/AP_Scripting_config.h>
#ifndef AP_RANGEFINDER_ENABLED
#define AP_RANGEFINDER_ENABLED 1
@ -9,3 +10,34 @@
#ifndef AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED
#define AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED AP_RANGEFINDER_ENABLED
#endif
#ifndef AP_RANGEFINDER_ANALOG_ENABLED
#define AP_RANGEFINDER_ANALOG_ENABLED AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED
#endif
#ifndef AP_RANGEFINDER_BBB_PRU_ENABLED
#define AP_RANGEFINDER_BBB_PRU_ENABLED ( \
AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED && \
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI \
)
#endif
#ifndef AP_RANGEFINDER_BLPING_ENABLED
#define AP_RANGEFINDER_BLPING_ENABLED AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED
#endif
#ifndef AP_RANGEFINDER_BEBOP_ENABLED
#define AP_RANGEFINDER_BEBOP_ENABLED \
AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED && \
(CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP || \
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO) && \
defined(HAVE_LIBIIO)
#endif
#ifndef AP_RANGEFINDER_LUA_ENABLED
#define AP_RANGEFINDER_LUA_ENABLED AP_SCRIPTING_ENABLED
#endif
#ifndef AP_RANGEFINDER_SIM_ENABLED
#define AP_RANGEFINDER_SIM_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL && AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED)
#endif