mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fixed post4066 bug: Prestart() inaccessible.
Change-Id: Ie179453b038458e77257c1b2d0acba7a4224f6c4
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user