Skip to content

Commit 9b0c462

Browse files
committed
remove sparkmax unplugged handler and deprecate related methods
1 parent 132ad8a commit 9b0c462

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/main/java/org/carlmontrobotics/lib199/DummySparkMaxAnswer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import org.mockito.invocation.InvocationOnMock;
1414

15+
@Deprecated
1516
public class DummySparkMaxAnswer extends REVLibErrorAnswer {
1617

1718
private static final long serialVersionUID = 2284848703213263465L;

src/main/java/org/carlmontrobotics/lib199/MotorControllerFactory.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,8 @@ public static CANSparkMax createSparkMax(int id, MotorConfig config) {
121121
CANSparkMax spark;
122122
if (RobotBase.isReal()) {
123123
spark = new CachedSparkMax(id, CANSparkMaxLowLevel.MotorType.kBrushless);
124-
if (spark.getFirmwareVersion() == 0) {
125-
spark.close();
126-
System.err.println("SparkMax on port: " + id + " is not connected!");
127-
return MotorErrors.createDummySparkMax();
128-
}
129124
} else {
130-
spark = MockSparkMax.createMockSparkMax(id, CANSparkMaxLowLevel.MotorType.kBrushless);
125+
spark = MockSparkMax.createMockSparkMax(id, CANSparkMaxLowLevel.MotorType.kBrushless);
131126
}
132127

133128
MotorErrors.reportSparkMaxTemp(spark, config.temperatureLimit);

src/main/java/org/carlmontrobotics/lib199/MotorErrors.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public static void printSparkMaxErrorMessages() {
9595
flags.keySet().forEach((spark) -> checkSparkMaxErrors(spark));
9696
}
9797

98+
@Deprecated
9899
public static CANSparkMax createDummySparkMax() {
99100
return DummySparkMaxAnswer.DUMMY_SPARK_MAX;
100101
}

0 commit comments

Comments
 (0)