1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

OP-1900 Fixed Constructor calling chain

This commit is contained in:
Corvus Corax 2015-05-23 17:11:19 +02:00
parent ffcd058478
commit 4b7edee534
3 changed files with 15 additions and 1 deletions

View File

@ -43,6 +43,10 @@ extern "C" {
// Private constants
// pointer to a singleton instance
FixedWingAutoTakeoffController *FixedWingAutoTakeoffController::p_inst = 0;
// Called when mode first engaged
void FixedWingAutoTakeoffController::Activate(void)
{

View File

@ -43,7 +43,17 @@ typedef enum {
} FixedWingAutoTakeoffControllerState_T;
class FixedWingAutoTakeoffController : public FixedWingFlyController {
protected:
static FixedWingAutoTakeoffController *p_inst;
public:
static FixedWingFlyController *instance()
{
if (!p_inst) {
p_inst = new FixedWingAutoTakeoffController();
}
return p_inst;
}
void Activate(void);
void UpdateAutoPilot(void);

View File

@ -33,7 +33,7 @@
#include "pathfollowercontrol.h"
class FixedWingFlyController : public PathFollowerControl {
private:
protected:
static FixedWingFlyController *p_inst;
FixedWingFlyController();