[wpilib] Add TimedRobot unit tests (#2771)

To make the tests reliable, the synchronization in simulation Notifiers
had to be reworked. StepTiming() now waits for all Notifiers to reach
HAL_WaitForNotifierAlarm(), then steps the time, then lets any expired
Notifiers run.

While there, we made some variable names more descriptive and added more
comments.
This commit is contained in:
Tyler Veness
2020-10-15 20:18:15 -07:00
committed by GitHub
parent a112b5e231
commit 8f3e5794b3
6 changed files with 776 additions and 26 deletions

View File

@@ -92,6 +92,7 @@ void HALSIM_ResumeTiming(void) {
HAL_Bool HALSIM_IsTimingPaused(void) { return IsTimingPaused(); }
void HALSIM_StepTiming(uint64_t delta) {
WaitNotifiers();
StepTiming(delta);
WakeupWaitNotifiers();
}