mirror of https://github.com/EspoTek/Labrador.git
Fixed crash when triggering state was uninitialised
This commit is contained in:
parent
23c2fee6f9
commit
003f3d94cd
|
@ -1,6 +1,7 @@
|
||||||
#include "isobuffer.h"
|
#include "isobuffer.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#include "isodriver.h"
|
#include "isodriver.h"
|
||||||
#include "uartstyledecoder.h"
|
#include "uartstyledecoder.h"
|
||||||
|
@ -121,6 +122,7 @@ std::unique_ptr<short[]> isoBuffer::readBuffer(double sampleWindow, int numSampl
|
||||||
double itr = delaySamples;
|
double itr = delaySamples;
|
||||||
for (int i = 0; i < numSamples && itr < m_insertedCount; i++)
|
for (int i = 0; i < numSamples && itr < m_insertedCount; i++)
|
||||||
{
|
{
|
||||||
|
assert(int(itr) >= 0);
|
||||||
readData[i] = bufferAt(int(itr));
|
readData[i] = bufferAt(int(itr));
|
||||||
|
|
||||||
if (singleBit)
|
if (singleBit)
|
||||||
|
|
|
@ -687,7 +687,13 @@ void isoDriver::frameActionGeneric(char CH1_mode, char CH2_mode) //0 for off, 1
|
||||||
|
|
||||||
double triggerDelay = 0;
|
double triggerDelay = 0;
|
||||||
if (triggerEnabled)
|
if (triggerEnabled)
|
||||||
|
{
|
||||||
triggerDelay = (triggerMode < 2) ? internalBuffer375_CH1->getDelayedTriggerPoint(window) - window : internalBuffer375_CH2->getDelayedTriggerPoint(window) - window;
|
triggerDelay = (triggerMode < 2) ? internalBuffer375_CH1->getDelayedTriggerPoint(window) - window : internalBuffer375_CH2->getDelayedTriggerPoint(window) - window;
|
||||||
|
|
||||||
|
if (triggerDelay < 0)
|
||||||
|
triggerDelay = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(singleShotEnabled && (triggerDelay != 0))
|
if(singleShotEnabled && (triggerDelay != 0))
|
||||||
singleShotTriggered(1);
|
singleShotTriggered(1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue