ref: da054584cd20bb9147d3fbc5d281490df6e0fd99
parent: a442a3da8d17be98ece8c9508be9388c062eee9b
author: Olav Sørensen <olav.sorensen@live.no>
date: Fri Oct 14 13:50:41 EDT 2022
Fix sync order issue for scopes
--- a/src/pt2_sync.c
+++ b/src/pt2_sync.c
@@ -157,13 +157,9 @@
if (flags & SET_SCOPE_PERIOD)
scopeSetPeriod(ch, c->period);
- if (flags & SET_SCOPE_DATA)
- scope[ch].newData = c->newData;
+ // the following handling order is important, don't change it!
- if (flags & SET_SCOPE_LENGTH)
- scope[ch].newLength = c->newLength;
-
- if (flags & STOP_SCOPE) // this must be handled *before* TRIGGER_SCOPE
+ if (flags & STOP_SCOPE)
scope[ch].active = false;
if (flags & TRIGGER_SCOPE)
@@ -172,6 +168,14 @@
s->newLength = c->triggerLength;
scopeTrigger(ch);
}
+
+ if (flags & SET_SCOPE_DATA)
+ scope[ch].newData = c->newData;
+
+ if (flags & SET_SCOPE_LENGTH)
+ scope[ch].newLength = c->newLength;
+
+ // ---------------------------------------------------------------
if (flags & UPDATE_ANALYZER)
updateSpectrumAnalyzer(c->analyzerVolume, c ->analyzerPeriod);