Skip to content

Commit 88a98d7

Browse files
committed
Enforce a minimum of 3 second before first synchronization attempt
1 parent dad9e36 commit 88a98d7

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Source/Processors/Synchronizer/Synchronizer.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,15 @@ void Synchronizer::startAcquisition()
829829
reset();
830830

831831
acquisitionIsActive = true;
832-
832+
firstSyncTimerCallbackPending = true;
833+
startTimer (3000);
833834
startTimer (1000);
834835
}
835836

836837
void Synchronizer::stopAcquisition()
837838
{
838839
acquisitionIsActive = false;
840+
firstSyncTimerCallbackPending = false;
839841

840842
stopTimer();
841843
}
@@ -979,6 +981,12 @@ void Synchronizer::hiResTimerCallback()
979981
return;
980982

981983
const ScopedLock sl (synchronizerLock);
984+
985+
if (firstSyncTimerCallbackPending)
986+
{
987+
firstSyncTimerCallbackPending = false;
988+
startTimer (1000);
989+
}
982990

983991
// First, attempt to decode any pending Harp barcodes
984992
for (auto [key, stream] : streams)

Source/Processors/Synchronizer/Synchronizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ class PLUGIN_API Synchronizer : public HighResolutionTimer
418418
private:
419419
int eventCount = 0;
420420
bool acquisitionIsActive = false;
421+
bool firstSyncTimerCallbackPending = false;
421422

422423
void hiResTimerCallback();
423424

0 commit comments

Comments
 (0)