mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilib] Make IterativeRobotBase::m_period private with getter
This commit is contained in:
committed by
Peter Johnson
parent
f00dfed7ac
commit
497b712f67
@@ -32,8 +32,6 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
* disabledPeriodic() - autonomousPeriodic() - teleopPeriodic() - testPeriodic()
|
||||
*/
|
||||
public abstract class IterativeRobotBase extends RobotBase {
|
||||
protected double m_period;
|
||||
|
||||
private enum Mode {
|
||||
kNone,
|
||||
kDisabled,
|
||||
@@ -43,6 +41,7 @@ public abstract class IterativeRobotBase extends RobotBase {
|
||||
}
|
||||
|
||||
private Mode m_lastMode = Mode.kNone;
|
||||
private final double m_period;
|
||||
private final Watchdog m_watchdog;
|
||||
private boolean m_ntFlushEnabled;
|
||||
|
||||
@@ -204,6 +203,11 @@ public abstract class IterativeRobotBase extends RobotBase {
|
||||
m_ntFlushEnabled = enabled;
|
||||
}
|
||||
|
||||
/** Gets time period between calls to Periodic() functions. */
|
||||
public double getPeriod() {
|
||||
return m_period;
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.CyclomaticComplexity")
|
||||
protected void loopFunc() {
|
||||
m_watchdog.reset();
|
||||
|
||||
@@ -137,11 +137,6 @@ public class TimedRobot extends IterativeRobotBase {
|
||||
NotifierJNI.stopNotifier(m_notifier);
|
||||
}
|
||||
|
||||
/** Get time period between calls to Periodic() functions. */
|
||||
public double getPeriod() {
|
||||
return m_period;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a callback to run at a specific period.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user