mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Make IsSimulation() checks constexpr (#2769)
This commit is contained in:
@@ -193,7 +193,7 @@ void CommandScheduler::Run() {
|
||||
// Run the periodic method of all registered subsystems.
|
||||
for (auto&& subsystem : m_impl->subsystems) {
|
||||
subsystem.getFirst()->Periodic();
|
||||
if (frc::RobotBase::IsSimulation()) {
|
||||
if constexpr (frc::RobotBase::IsSimulation()) {
|
||||
subsystem.getFirst()->SimulationPeriodic();
|
||||
}
|
||||
m_watchdog.AddEpoch("Subsystem Periodic()");
|
||||
|
||||
@@ -24,7 +24,7 @@ IterativeRobot::IterativeRobot() : IterativeRobotBase(kPacketPeriod) {
|
||||
void IterativeRobot::StartCompetition() {
|
||||
RobotInit();
|
||||
|
||||
if (IsSimulation()) {
|
||||
if constexpr (IsSimulation()) {
|
||||
SimulationInit();
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ void IterativeRobotBase::LoopFunc() {
|
||||
Shuffleboard::Update();
|
||||
m_watchdog.AddEpoch("Shuffleboard::Update()");
|
||||
|
||||
if (IsSimulation()) {
|
||||
if constexpr (IsSimulation()) {
|
||||
SimulationPeriodic();
|
||||
m_watchdog.AddEpoch("SimulationPeriodic()");
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ using namespace frc;
|
||||
void TimedRobot::StartCompetition() {
|
||||
RobotInit();
|
||||
|
||||
if (IsSimulation()) {
|
||||
if constexpr (IsSimulation()) {
|
||||
SimulationInit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user