Skip to content

Commit

Permalink
Deprecate RobotInit
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed May 14, 2024
1 parent dc00a13 commit ba66a8f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wpilibc/src/main/native/cpp/TimedRobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
#include <hal/DriverStation.h>
#include <hal/FRCUsageReporting.h>
#include <hal/Notifier.h>
#include <wpi/deprecated.h>

#include "frc/Errors.h"
#include "frc/Timer.h"

using namespace frc;

void TimedRobot::StartCompetition() {
WPI_IGNORE_DEPRECATED
RobotInit();
WPI_UNIGNORE_DEPRECATED

if constexpr (IsSimulation()) {
SimulationInit();
Expand Down
1 change: 1 addition & 0 deletions wpilibc/src/main/native/include/frc/IterativeRobotBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class IterativeRobotBase : public RobotBase {
* waits for enable will cause the robot to never indicate that the code is
* ready, causing the robot to be bypassed in a match.
*/
[[deprecated("Use the robot class constructor instead.")]]
virtual void RobotInit();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ protected IterativeRobotBase(double period) {
* <p>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.
*
* @deprecated Use the robot class constructor instead.
*/
@Deprecated(since = "2025", forRemoval = true)
public void robotInit() {}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void close() {

/** Provide an alternate "main loop" via startCompetition(). */
@Override
@SuppressWarnings("removal")
public void startCompetition() {
robotInit();

Expand Down

0 comments on commit ba66a8f

Please sign in to comment.