AP_RSSI: unify singleton naming to _singleton and get_singleton()

This commit is contained in:
Tom Pittenger 2019-02-09 21:04:49 -08:00 committed by Tom Pittenger
parent 132a93189d
commit 3032e5c3d9
2 changed files with 8 additions and 8 deletions

View File

@ -100,10 +100,10 @@ const AP_Param::GroupInfo AP_RSSI::var_info[] = {
AP_RSSI::AP_RSSI() AP_RSSI::AP_RSSI()
{ {
AP_Param::setup_object_defaults(this, var_info); AP_Param::setup_object_defaults(this, var_info);
if (_s_instance) { if (_singleton) {
AP_HAL::panic("Too many RSSI sensors"); AP_HAL::panic("Too many RSSI sensors");
} }
_s_instance = this; _singleton = this;
} }
// destructor // destructor
@ -114,9 +114,9 @@ AP_RSSI::~AP_RSSI(void)
/* /*
* Get the AP_RSSI singleton * 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 // 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 { namespace AP {
AP_RSSI *rssi() AP_RSSI *rssi()
{ {
return AP_RSSI::get_instance(); return AP_RSSI::get_singleton();
} }
}; };

View File

@ -38,7 +38,7 @@ public:
// destructor // destructor
~AP_RSSI(void); ~AP_RSSI(void);
static AP_RSSI *get_instance(); static AP_RSSI *get_singleton();
// Initialize the rssi object and prepare it for use // Initialize the rssi object and prepare it for use
void init(); void init();
@ -59,7 +59,7 @@ public:
private: private:
static AP_RSSI *_s_instance; static AP_RSSI *_singleton;
// RSSI parameters // RSSI parameters
AP_Int8 rssi_type; // Type of RSSI being used AP_Int8 rssi_type; // Type of RSSI being used