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"
// singleton
AP_RCProtocol *AP_RCProtocol::instance;
AP_RCProtocol *AP_RCProtocol::_singleton;
void AP_RCProtocol::init()
{
@ -45,7 +45,7 @@ AP_RCProtocol::~AP_RCProtocol()
backend[i] = nullptr;
}
}
instance = nullptr;
_singleton = nullptr;
}
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 {
public:
AP_RCProtocol() {
instance = this;
_singleton = this;
}
~AP_RCProtocol();
@ -79,8 +79,8 @@ public:
}
// access to singleton
static AP_RCProtocol *get_instance(void) {
return instance;
static AP_RCProtocol *get_singleton(void) {
return _singleton;
}
private:
@ -93,7 +93,7 @@ private:
bool _valid_serial_prot = false;
uint8_t _good_frames[NONE];
static AP_RCProtocol *instance;
static AP_RCProtocol *_singleton;
};
#include "AP_RCProtocol_Backend.h"