From a65cd27435c2839e27d85a20549311ad63602dbd Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 25 Aug 2024 15:30:12 +1000 Subject: [PATCH] AP_Beacon: allow hwdefs to override number of beacons ... also a few other variables. Also move these out of the main header file as one is internal and the others should go in the ocnfig. in case the values are used elsewhere --- libraries/AP_Beacon/AP_Beacon.cpp | 4 ++++ libraries/AP_Beacon/AP_Beacon.h | 4 ---- libraries/AP_Beacon/AP_Beacon_config.h | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Beacon/AP_Beacon.cpp b/libraries/AP_Beacon/AP_Beacon.cpp index 1b9de318d4..c2044ad758 100644 --- a/libraries/AP_Beacon/AP_Beacon.cpp +++ b/libraries/AP_Beacon/AP_Beacon.cpp @@ -28,6 +28,10 @@ extern const AP_HAL::HAL &hal; +#ifndef AP_BEACON_MINIMUM_FENCE_BEACONS +#define AP_BEACON_MINIMUM_FENCE_BEACONS 3 +#endif + // table of user settable parameters const AP_Param::GroupInfo AP_Beacon::var_info[] = { diff --git a/libraries/AP_Beacon/AP_Beacon.h b/libraries/AP_Beacon/AP_Beacon.h index 98f7c37775..aaebfa86ad 100644 --- a/libraries/AP_Beacon/AP_Beacon.h +++ b/libraries/AP_Beacon/AP_Beacon.h @@ -25,10 +25,6 @@ class AP_Beacon_Backend; -#define AP_BEACON_MAX_BEACONS 4 -#define AP_BEACON_TIMEOUT_MS 300 -#define AP_BEACON_MINIMUM_FENCE_BEACONS 3 - class AP_Beacon { public: diff --git a/libraries/AP_Beacon/AP_Beacon_config.h b/libraries/AP_Beacon/AP_Beacon_config.h index 38d3533142..d3d866015f 100644 --- a/libraries/AP_Beacon/AP_Beacon_config.h +++ b/libraries/AP_Beacon/AP_Beacon_config.h @@ -6,6 +6,14 @@ #define AP_BEACON_ENABLED 1 #endif +#ifndef AP_BEACON_MAX_BEACONS +#define AP_BEACON_MAX_BEACONS 4 +#endif + +#ifndef AP_BEACON_TIMEOUT_MS +#define AP_BEACON_TIMEOUT_MS 300 +#endif + #ifndef AP_BEACON_BACKEND_DEFAULT_ENABLED #define AP_BEACON_BACKEND_DEFAULT_ENABLED AP_BEACON_ENABLED #endif