[hal] Update waitForProgramStart to optionally wait for first notifier (#8932)

This addresses a race condition caused by TimedRobot and other
frameworks not creating their first notifier alarm until after signaling
program start.

Default this to true because it's the most common desired use case when
combined with TimedRobot.
This commit is contained in:
Peter Johnson
2026-05-29 23:09:25 -07:00
committed by GitHub
parent 635e971a02
commit 9adffd356d
9 changed files with 44 additions and 15 deletions

View File

@@ -141,13 +141,13 @@ Java_org_wpilib_hardware_hal_simulation_SimulatorJNI_setRuntimeType
/*
* Class: org_wpilib_hardware_hal_simulation_SimulatorJNI
* Method: waitForProgramStart
* Signature: ()V
* Signature: (Z)V
*/
JNIEXPORT void JNICALL
Java_org_wpilib_hardware_hal_simulation_SimulatorJNI_waitForProgramStart
(JNIEnv*, jclass)
(JNIEnv*, jclass, jboolean waitForFirstNotifier)
{
HALSIM_WaitForProgramStart();
HALSIM_WaitForProgramStart(waitForFirstNotifier);
}
/*