[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

@@ -20,9 +20,18 @@ public final class SimHooks {
SimulatorJNI.setRuntimeType(type);
}
/** Waits until the user program has started. */
/** Waits until the user program has started and the first notifier alarm has been armed. */
public static void waitForProgramStart() {
SimulatorJNI.waitForProgramStart();
waitForProgramStart(true);
}
/**
* Waits until the user program has started.
*
* @param waitForFirstNotifier wait for the first notifier alarm to be armed
*/
public static void waitForProgramStart(boolean waitForFirstNotifier) {
SimulatorJNI.waitForProgramStart(waitForFirstNotifier);
}
/**