AP_RCprotocol: unify singleton naming to _singleton and get_singleton()

This commit is contained in:
Tom Pittenger 2019-02-09 21:05:11 -08:00 committed by Tom Pittenger
parent 3032e5c3d9
commit a597c2972c
2 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@
#include "AP_RCProtocol_ST24.h" #include "AP_RCProtocol_ST24.h"
// singleton // singleton
AP_RCProtocol *AP_RCProtocol::instance; AP_RCProtocol *AP_RCProtocol::_singleton;
void AP_RCProtocol::init() void AP_RCProtocol::init()
{ {
@ -45,7 +45,7 @@ AP_RCProtocol::~AP_RCProtocol()
backend[i] = nullptr; backend[i] = nullptr;
} }
} }
instance = nullptr; _singleton = nullptr;
} }
void AP_RCProtocol::process_pulse(uint32_t width_s0, uint32_t width_s1) void AP_RCProtocol::process_pulse(uint32_t width_s0, uint32_t width_s1)

View File

@ -26,7 +26,7 @@ class AP_RCProtocol_Backend;
class AP_RCProtocol { class AP_RCProtocol {
public: public:
AP_RCProtocol() { AP_RCProtocol() {
instance = this; _singleton = this;
} }
~AP_RCProtocol(); ~AP_RCProtocol();
@ -79,8 +79,8 @@ public:
} }
// access to singleton // access to singleton
static AP_RCProtocol *get_instance(void) { static AP_RCProtocol *get_singleton(void) {
return instance; return _singleton;
} }
private: private:
@ -93,7 +93,7 @@ private:
bool _valid_serial_prot = false; bool _valid_serial_prot = false;
uint8_t _good_frames[NONE]; uint8_t _good_frames[NONE];
static AP_RCProtocol *instance; static AP_RCProtocol *_singleton;
}; };
#include "AP_RCProtocol_Backend.h" #include "AP_RCProtocol_Backend.h"