Corrected intempestive trigger on pre-trigger delay condition

This commit is contained in:
f4exb 2015-07-22 01:45:57 +02:00
parent 71cb2c22d4
commit e8708d00fd
1 changed files with 20 additions and 17 deletions

View File

@ -82,25 +82,28 @@ void ScopeVis::feed(SampleVector::const_iterator begin, SampleVector::const_iter
while(begin < end)
{
bool trigger = triggerCondition(begin);
if ((trigger ^ !m_triggerPositiveEdge) && (m_tracebackCount > m_triggerPre))
if (m_tracebackCount > m_triggerPre)
{
if (m_armed)
{
m_triggerState = Triggered;
m_armed = false;
m_triggerPoint = begin;
// fill beginning of m_trace with delayed samples from the trace memory FIFO. Increment m_fill accordingly.
if (m_triggerPre) { // do this process only if there is a pre-trigger delay
std::copy(m_traceback.end() - m_triggerPre - 1, m_traceback.end() - 1, m_trace.begin());
m_fill = m_triggerPre; // Increment m_fill accordingly (from 0).
}
break;
if (trigger ^ !m_triggerPositiveEdge)
{
if (m_armed)
{
m_triggerState = Triggered;
m_armed = false;
m_triggerPoint = begin;
// fill beginning of m_trace with delayed samples from the trace memory FIFO. Increment m_fill accordingly.
if (m_triggerPre) { // do this process only if there is a pre-trigger delay
std::copy(m_traceback.end() - m_triggerPre - 1, m_traceback.end() - 1, m_trace.begin());
m_fill = m_triggerPre; // Increment m_fill accordingly (from 0).
}
break;
}
}
}
else
{
m_armed = true;
}
else
{
m_armed = true;
}
}
++begin;
}
}