mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user