mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
Fix main function initialization (#1176)
I don't have a good way to ensure this always works, so this is going to be a documentation issue. But initializeHardwareConfiguration is now reentrant, so we can just have all tests call it.
This commit is contained in:
committed by
Peter Johnson
parent
f5b1028b5a
commit
89d15f061b
@@ -28,7 +28,7 @@ import edu.wpi.first.wpilibj.hal.PowerJNI;
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.ExcessiveClassLength",
|
||||
"PMD.ExcessivePublicCount", "PMD.GodClass", "PMD.TooManyFields",
|
||||
"PMD.TooManyMethods"})
|
||||
public class DriverStation implements RobotState.Interface {
|
||||
public class DriverStation {
|
||||
/**
|
||||
* Number of Joystick Ports.
|
||||
*/
|
||||
@@ -630,7 +630,6 @@ public class DriverStation implements RobotState.Interface {
|
||||
*
|
||||
* @return True if the robot is enabled, false otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
synchronized (m_controlWordMutex) {
|
||||
updateControlWord(false);
|
||||
@@ -643,7 +642,6 @@ public class DriverStation implements RobotState.Interface {
|
||||
*
|
||||
* @return True if the robot should be disabled, false otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return !isEnabled();
|
||||
}
|
||||
@@ -654,7 +652,6 @@ public class DriverStation implements RobotState.Interface {
|
||||
*
|
||||
* @return True if autonomous mode should be enabled, false otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean isAutonomous() {
|
||||
synchronized (m_controlWordMutex) {
|
||||
updateControlWord(false);
|
||||
@@ -668,7 +665,6 @@ public class DriverStation implements RobotState.Interface {
|
||||
*
|
||||
* @return True if operator-controlled mode should be enabled, false otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean isOperatorControl() {
|
||||
return !(isAutonomous() || isTest());
|
||||
}
|
||||
@@ -679,7 +675,6 @@ public class DriverStation implements RobotState.Interface {
|
||||
*
|
||||
* @return True if test mode should be enabled, false otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean isTest() {
|
||||
synchronized (m_controlWordMutex) {
|
||||
updateControlWord(false);
|
||||
|
||||
Reference in New Issue
Block a user