Skip to content

Commit 85a8fc9

Browse files
authored
[hal] Add SystemCore to Java runtime type (#7932)
1 parent 3681121 commit 85a8fc9

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

hal/src/main/java/edu/wpi/first/hal/HALUtil.java

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public final class HALUtil extends JNIWrapper {
4343
/** Simulation runtime. */
4444
public static final int RUNTIME_SIMULATION = 2;
4545

46+
/** SystemCore. */
47+
public static final int RUNTIME_SYSTEMCORE = 3;
48+
4649
/**
4750
* Returns the FPGA Version number.
4851
*

hal/src/main/native/cpp/jni/HALUtil.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ static_assert(edu_wpi_first_hal_HALUtil_RUNTIME_ROBORIO2 ==
3535
HAL_Runtime_RoboRIO2);
3636
static_assert(edu_wpi_first_hal_HALUtil_RUNTIME_SIMULATION ==
3737
HAL_Runtime_Simulation);
38+
static_assert(edu_wpi_first_hal_HALUtil_RUNTIME_SYSTEMCORE ==
39+
HAL_Runtime_SystemCore);
3840

3941
static JavaVM* jvm = nullptr;
4042
static JException illegalArgExCls;

wpilibj/src/main/java/edu/wpi/first/wpilibj/RuntimeType.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ public enum RuntimeType {
1313
/** roboRIO 2.0. */
1414
kRoboRIO2(HALUtil.RUNTIME_ROBORIO2),
1515
/** Simulation runtime. */
16-
kSimulation(HALUtil.RUNTIME_SIMULATION);
16+
kSimulation(HALUtil.RUNTIME_SIMULATION),
17+
/** SystemCore. */
18+
kSystemCore(HALUtil.RUNTIME_SYSTEMCORE);
1719

1820
/** RuntimeType value. */
1921
public final int value;
@@ -32,6 +34,7 @@ public static RuntimeType getValue(int type) {
3234
return switch (type) {
3335
case HALUtil.RUNTIME_ROBORIO -> RuntimeType.kRoboRIO;
3436
case HALUtil.RUNTIME_ROBORIO2 -> RuntimeType.kRoboRIO2;
37+
case HALUtil.RUNTIME_SYSTEMCORE -> RuntimeType.kSystemCore;
3538
default -> RuntimeType.kSimulation;
3639
};
3740
}

0 commit comments

Comments
 (0)