mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[sim] Provide method to set the runtime type (#2539)
This is needed for extensions that effectively access real hardware and want to disable the "simulation" parts of user code.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -13,6 +13,10 @@ public final class SimHooks {
|
||||
private SimHooks() {
|
||||
}
|
||||
|
||||
public static void setHALRuntimeType(int type) {
|
||||
SimulatorJNI.setRuntimeType(type);
|
||||
}
|
||||
|
||||
public static void waitForProgramStart() {
|
||||
SimulatorJNI.waitForProgramStart();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -10,6 +10,7 @@ package edu.wpi.first.hal.sim.mockdata;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class SimulatorJNI extends JNIWrapper {
|
||||
public static native void setRuntimeType(int type);
|
||||
public static native void waitForProgramStart();
|
||||
public static native void setProgramStarted();
|
||||
public static native void restartTiming();
|
||||
|
||||
Reference in New Issue
Block a user