Skip to content

Commit

Permalink
M2kImpl: block the digital/analog interface until started
Browse files Browse the repository at this point in the history
For the case where there is a trigger either on the analog interface or digital interface, we need to disable the triggering interface in order to block the acquisition. When both analog and digital interfaces are started we then release the corresponding trigger. Otherwise there will be a larger delay due to the analog acquisition being started much sooner than the digital acquisition.

Signed-off-by: DanielGuramulta <Daniel.Guramulta@analog.com>
  • Loading branch information
DanielGuramulta authored and teoperisanu committed Sep 2, 2020
1 parent dbb3e4f commit 713d80d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/m2k_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,11 @@ void M2kImpl::startMixedSignalAcquisition(unsigned int nb_samples)
m_trigger->setDigitalSource(SRC_ANALOG_IN);
} else if (!hasDigitalTrigger) {
// analog trigger
m_trigger->setAnalogSource(NO_SOURCE);
m_trigger->setDigitalSource(SRC_ANALOG_IN);
} else if (!hasAnalogTrigger) {
// digital trigger
m_trigger->setDigitalSource(SRC_DISABLED);
m_trigger->setAnalogSource(SRC_DIGITAL_IN);
}

Expand All @@ -360,6 +362,10 @@ void M2kImpl::startMixedSignalAcquisition(unsigned int nb_samples)
if (!hasAnalogTrigger && !hasDigitalTrigger) {
m_trigger->setAnalogMode(CHANNEL_1, ALWAYS);
m_trigger->setAnalogSource(CHANNEL_1);
} else if (!hasDigitalTrigger) {
m_trigger->setAnalogSource(analogSource);
} else if (!hasAnalogTrigger) {
m_trigger->setDigitalSource(digitalSource);
}
}

Expand Down

0 comments on commit 713d80d

Please sign in to comment.