mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Add simulation pause/resume/step support
Calling HALSIM_PauseTiming pauses the FPGA clock and notifiers. Calling HALSIM_ResumeTiming resumes the FPGA clock and notifiers. Calling HALSIM_StepTiming steps the FPGA clock and runs applicable notifiers. This will effectively pause TimedRobot and any other notifier-based events, but of course will not pause user threads that do not use the notifier (e.g. image processing).
This commit is contained in:
@@ -142,6 +142,54 @@ Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_restartTiming
|
||||
HALSIM_RestartTiming();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
|
||||
* Method: pauseTiming
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_pauseTiming
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HALSIM_PauseTiming();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
|
||||
* Method: resumeTiming
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_resumeTiming
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HALSIM_ResumeTiming();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
|
||||
* Method: isTimingPaused
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_isTimingPaused
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
return HALSIM_IsTimingPaused();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
|
||||
* Method: stepTiming
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_stepTiming
|
||||
(JNIEnv*, jclass, jlong delta)
|
||||
{
|
||||
HALSIM_StepTiming(delta);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
|
||||
* Method: resetHandles
|
||||
|
||||
Reference in New Issue
Block a user