[wpilib] Remove IterativeRobot base class

TimedRobot supersedes it (see commit 81498e6 for reasoning).
This commit is contained in:
Tyler Veness
2019-04-10 20:21:11 -07:00
committed by Peter Johnson
parent 3c08461685
commit f00dfed7ac
3 changed files with 0 additions and 160 deletions

View File

@@ -1,46 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "frc/IterativeRobot.h"
#include <hal/DriverStation.h>
#include <hal/FRCUsageReporting.h>
#include "frc/DriverStation.h"
using namespace frc;
static constexpr auto kPacketPeriod = 0.02_s;
IterativeRobot::IterativeRobot() : IterativeRobotBase(kPacketPeriod) {
HAL_Report(HALUsageReporting::kResourceType_Framework,
HALUsageReporting::kFramework_Iterative);
}
void IterativeRobot::StartCompetition() {
RobotInit();
if constexpr (IsSimulation()) {
SimulationInit();
}
// Tell the DS that the robot is ready to be enabled
HAL_ObserveUserProgramStarting();
// Loop forever, calling the appropriate mode-dependent function
while (true) {
// Wait for driver station data so the loop doesn't hog the CPU
DriverStation::GetInstance().WaitForData();
if (m_exit) {
break;
}
LoopFunc();
}
}
void IterativeRobot::EndCompetition() {
m_exit = true;
DriverStation::GetInstance().WakeupWaitForData();
}