Fixed post4066 bug: Prestart() inaccessible.

Change-Id: Ie179453b038458e77257c1b2d0acba7a4224f6c4
This commit is contained in:
Colby Skeggs
2014-12-17 07:35:55 -08:00
parent b72eb4b812
commit 47443b4e1e
2 changed files with 9 additions and 2 deletions

View File

@@ -16,8 +16,7 @@ class DriverStation;
if (!HALInitialize()){std::cerr<<"FATAL ERROR: HAL could not be initialized"<<std::endl;return -1;} \
HALReport(HALUsageReporting::kResourceType_Language, HALUsageReporting::kLanguage_CPlusPlus); \
_ClassName_ *robot = new _ClassName_(); \
robot->Prestart();\
robot->StartCompetition(); \
RobotBase::robotSetup(robot); \
return 0; \
}
@@ -45,6 +44,8 @@ public:
static void startRobotTask(FUNCPTR factory);
static void robotTask(FUNCPTR factory, Task *task);
virtual void StartCompetition() = 0;
static void robotSetup(RobotBase *robot);
protected:
virtual ~RobotBase();

View File

@@ -37,6 +37,12 @@ RobotBase &RobotBase::getInstance()
return *m_instance;
}
void RobotBase::robotSetup(RobotBase *robot)
{
robot->Prestart();
robot->StartCompetition();
}
/**
* Constructor for a generic robot program.
* User code should be placed in the constructor that runs before the Autonomous or Operator