mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Notifier: reset updatedAlarm before waiting (#946)
- If this isn't done, then the wait will always be performed at least twice
This commit is contained in:
committed by
Peter Johnson
parent
7a34f5d17d
commit
b7ea481bf9
@@ -136,6 +136,9 @@ uint64_t HAL_WaitForNotifierAlarm(HAL_NotifierHandle notifierHandle,
|
||||
waitTime = notifier->waitTime * 1e-6;
|
||||
}
|
||||
|
||||
// Don't wait twice
|
||||
notifier->updatedAlarm = false;
|
||||
|
||||
auto timeoutTime =
|
||||
hal::fpga_clock::epoch() + std::chrono::duration<double>(waitTime);
|
||||
notifier->cond.wait_until(lock, timeoutTime);
|
||||
|
||||
Reference in New Issue
Block a user