Fixed crash when triggering state was uninitialised

This commit is contained in:
Chris Esposito 2019-04-25 10:41:29 +10:00
parent 23c2fee6f9
commit 003f3d94cd
2 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#include "isobuffer.h"
#include <algorithm>
#include <cassert>
#include "isodriver.h"
#include "uartstyledecoder.h"
@ -121,6 +122,7 @@ std::unique_ptr<short[]> 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)

View File

@ -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);