mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[examples] Prepare for RobotInit deprecation by updating examples (#6623)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
@@ -63,10 +63,8 @@ class IterativeRobotBase : public RobotBase {
|
||||
* which will be called when the robot is first powered on. It will be called
|
||||
* exactly one time.
|
||||
*
|
||||
* Warning: the Driver Station "Robot Code" light and FMS "Robot Ready"
|
||||
* indicators will be off until RobotInit() exits. Code in RobotInit() that
|
||||
* waits for enable will cause the robot to never indicate that the code is
|
||||
* ready, causing the robot to be bypassed in a match.
|
||||
* Note: This method is functionally identical to the class constructor so
|
||||
* that should be used instead.
|
||||
*/
|
||||
virtual void RobotInit();
|
||||
|
||||
|
||||
@@ -48,9 +48,7 @@ class MockRobot : public TimedRobot {
|
||||
std::atomic<uint32_t> m_teleopPeriodicCount{0};
|
||||
std::atomic<uint32_t> m_testPeriodicCount{0};
|
||||
|
||||
MockRobot() : TimedRobot{kPeriod} {}
|
||||
|
||||
void RobotInit() override { m_robotInitCount++; }
|
||||
MockRobot() : TimedRobot{kPeriod} { m_robotInitCount++; }
|
||||
|
||||
void SimulationInit() override { m_simulationInitCount++; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user