TimedRobot.cpp: Fix deprecation warning (#1846)

For both TimedRobot and IterativeRobotBase, use delegating constructors
to reduce code duplication.
This commit is contained in:
Peter Johnson
2019-08-24 21:13:29 -07:00
committed by GitHub
parent b2861f8948
commit 4cd8a56672
2 changed files with 2 additions and 10 deletions

View File

@@ -24,8 +24,7 @@
using namespace frc;
IterativeRobotBase::IterativeRobotBase(double period)
: m_period(period),
m_watchdog(period, [this] { PrintLoopOverrunMessage(); }) {}
: IterativeRobotBase(units::second_t(period)) {}
IterativeRobotBase::IterativeRobotBase(units::second_t period)
: m_period(period.to<double>()),