From 39b7f631407923e40d1a91c298486b9613e2f038 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 1 Jun 2022 12:12:32 +1000 Subject: [PATCH] AP_Beacon: stop passing serialmanager into beacon constructor --- libraries/AP_Beacon/AP_Beacon.cpp | 3 +-- libraries/AP_Beacon/AP_Beacon.h | 4 +--- libraries/AP_Beacon/AP_Beacon_Backend.cpp | 1 + .../examples/AP_Marvelmind_test/AP_Marvelmind_test.cpp | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Beacon/AP_Beacon.cpp b/libraries/AP_Beacon/AP_Beacon.cpp index 81ca563a77..4491ff3556 100644 --- a/libraries/AP_Beacon/AP_Beacon.cpp +++ b/libraries/AP_Beacon/AP_Beacon.cpp @@ -74,8 +74,7 @@ const AP_Param::GroupInfo AP_Beacon::var_info[] = { AP_GROUPEND }; -AP_Beacon::AP_Beacon(AP_SerialManager &_serial_manager) : - serial_manager(_serial_manager) +AP_Beacon::AP_Beacon() { #if CONFIG_HAL_BOARD == HAL_BOARD_SITL if (_singleton != nullptr) { diff --git a/libraries/AP_Beacon/AP_Beacon.h b/libraries/AP_Beacon/AP_Beacon.h index c4a91defb3..6cb02b91c8 100644 --- a/libraries/AP_Beacon/AP_Beacon.h +++ b/libraries/AP_Beacon/AP_Beacon.h @@ -17,7 +17,6 @@ #include #include #include -#include #include class AP_Beacon_Backend; @@ -31,7 +30,7 @@ class AP_Beacon public: friend class AP_Beacon_Backend; - AP_Beacon(AP_SerialManager &_serial_manager); + AP_Beacon(); // get singleton instance static AP_Beacon *get_singleton() { return _singleton; } @@ -130,7 +129,6 @@ private: // external references AP_Beacon_Backend *_driver; - AP_SerialManager &serial_manager; // last known position Vector3f veh_pos_ned; diff --git a/libraries/AP_Beacon/AP_Beacon_Backend.cpp b/libraries/AP_Beacon/AP_Beacon_Backend.cpp index e970a78b5e..f0dd4191bd 100644 --- a/libraries/AP_Beacon/AP_Beacon_Backend.cpp +++ b/libraries/AP_Beacon/AP_Beacon_Backend.cpp @@ -16,6 +16,7 @@ #include "AP_Beacon_Backend.h" // debug #include +#include /* base class constructor. diff --git a/libraries/AP_Beacon/examples/AP_Marvelmind_test/AP_Marvelmind_test.cpp b/libraries/AP_Beacon/examples/AP_Marvelmind_test/AP_Marvelmind_test.cpp index 6e605843c8..a3dae7a7f1 100644 --- a/libraries/AP_Beacon/examples/AP_Marvelmind_test/AP_Marvelmind_test.cpp +++ b/libraries/AP_Beacon/examples/AP_Marvelmind_test/AP_Marvelmind_test.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include void setup(); @@ -15,7 +16,7 @@ void set_object_value_and_report(const void *object_pointer, const AP_HAL::HAL& hal = AP_HAL::get_HAL(); static AP_SerialManager serial_manager; -AP_Beacon beacon{serial_manager}; +AP_Beacon beacon; // try to set the object value but provide diagnostic if it failed void set_object_value_and_report(const void *object_pointer,