diff --git a/Desktop_Interface/isobuffer.cpp b/Desktop_Interface/isobuffer.cpp index b07c0cec..a62bb53d 100644 --- a/Desktop_Interface/isobuffer.cpp +++ b/Desktop_Interface/isobuffer.cpp @@ -1,6 +1,7 @@ #include "isobuffer.h" #include +#include #include "isodriver.h" #include "uartstyledecoder.h" @@ -121,6 +122,7 @@ std::unique_ptr isoBuffer::readBuffer(double sampleWindow, int numSampl double itr = delaySamples; for (int i = 0; i < numSamples && itr < m_insertedCount; i++) { + assert(int(itr) >= 0); readData[i] = bufferAt(int(itr)); if (singleBit) diff --git a/Desktop_Interface/isodriver.cpp b/Desktop_Interface/isodriver.cpp index f6d945b3..1e81ad9c 100644 --- a/Desktop_Interface/isodriver.cpp +++ b/Desktop_Interface/isodriver.cpp @@ -687,7 +687,13 @@ void isoDriver::frameActionGeneric(char CH1_mode, char CH2_mode) //0 for off, 1 double triggerDelay = 0; if (triggerEnabled) + { triggerDelay = (triggerMode < 2) ? internalBuffer375_CH1->getDelayedTriggerPoint(window) - window : internalBuffer375_CH2->getDelayedTriggerPoint(window) - window; + + if (triggerDelay < 0) + triggerDelay = 0; + } + if(singleShotEnabled && (triggerDelay != 0)) singleShotTriggered(1);