fix gap override logic (#3946)

This commit is contained in:
Matthew Kennedy 2022-02-18 17:13:45 -08:00 committed by GitHub
parent 0b8ce386f0
commit 1af68ff30b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -137,11 +137,15 @@ void Engine::initializeTriggerWaveform() {
*/
if (engineConfiguration->overrideTriggerGaps) {
int gapIndex = 0;
for (;gapIndex<=engineConfiguration->overrideTriggerGaps;gapIndex++) {
// copy however many the user wants
for (; gapIndex < engineConfiguration->gapTrackingLengthOverride; gapIndex++) {
float gapOverrideFrom = engineConfiguration->triggerGapOverrideFrom[gapIndex];
float gapOverrideTo = engineConfiguration->triggerGapOverrideTo[gapIndex];
TRIGGER_WAVEFORM(setTriggerSynchronizationGap3(/*gapIndex*/gapIndex, gapOverrideFrom, gapOverrideTo));
}
// fill the remainder with the default gaps
for (; gapIndex < GAP_TRACKING_LENGTH; gapIndex++) {
engine->triggerCentral.triggerShape.syncronizationRatioFrom[gapIndex] = NAN;
engine->triggerCentral.triggerShape.syncronizationRatioTo[gapIndex] = NAN;