[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

@@ -12,8 +12,8 @@ void SetRuntimeType(HAL_RuntimeType type) {
HALSIM_SetRuntimeType(type);
}
void WaitForProgramStart() {
HALSIM_WaitForProgramStart();
void WaitForProgramStart(bool waitForFirstNotifier) {
HALSIM_WaitForProgramStart(waitForFirstNotifier);
}
void SetProgramStarted(bool started) {

View File

@@ -21,8 +21,10 @@ void SetRuntimeType(HAL_RuntimeType type);
/**
* Waits until the user program has started.
*
* @param waitForFirstNotifier wait for the first notifier alarm to be armed
*/
void WaitForProgramStart();
void WaitForProgramStart(bool waitForFirstNotifier = true);
/**
* Sets flag that indicates if the user program has started.