diff --git a/libraries/AP_RSSI/AP_RSSI.cpp b/libraries/AP_RSSI/AP_RSSI.cpp index 4f3f14b837..00c5267297 100644 --- a/libraries/AP_RSSI/AP_RSSI.cpp +++ b/libraries/AP_RSSI/AP_RSSI.cpp @@ -100,10 +100,10 @@ const AP_Param::GroupInfo AP_RSSI::var_info[] = { AP_RSSI::AP_RSSI() { AP_Param::setup_object_defaults(this, var_info); - if (_s_instance) { + if (_singleton) { AP_HAL::panic("Too many RSSI sensors"); } - _s_instance = this; + _singleton = this; } // destructor @@ -114,9 +114,9 @@ AP_RSSI::~AP_RSSI(void) /* * Get the AP_RSSI singleton */ -AP_RSSI *AP_RSSI::get_instance() +AP_RSSI *AP_RSSI::get_singleton() { - return _s_instance; + return _singleton; } // Initialize the rssi object and prepare it for use @@ -310,13 +310,13 @@ void AP_RSSI::irq_handler(uint8_t pin, bool pin_high, uint32_t timestamp_us) } } -AP_RSSI *AP_RSSI::_s_instance = nullptr; +AP_RSSI *AP_RSSI::_singleton = nullptr; namespace AP { AP_RSSI *rssi() { - return AP_RSSI::get_instance(); + return AP_RSSI::get_singleton(); } }; diff --git a/libraries/AP_RSSI/AP_RSSI.h b/libraries/AP_RSSI/AP_RSSI.h index dd501f857d..2a99bda1d2 100644 --- a/libraries/AP_RSSI/AP_RSSI.h +++ b/libraries/AP_RSSI/AP_RSSI.h @@ -38,7 +38,7 @@ public: // destructor ~AP_RSSI(void); - static AP_RSSI *get_instance(); + static AP_RSSI *get_singleton(); // Initialize the rssi object and prepare it for use void init(); @@ -59,7 +59,7 @@ public: private: - static AP_RSSI *_s_instance; + static AP_RSSI *_singleton; // RSSI parameters AP_Int8 rssi_type; // Type of RSSI being used