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:
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user