Skip to content

Commit dbeb7ce

Browse files
committed
ThunderScope: make sure memory depths are valid before initializing the trigger for the first time. Also eliminate a redundant PushTrigger() call
1 parent 60f7ff3 commit dbeb7ce

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

scopehal/RemoteBridgeOscilloscope.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ void RemoteBridgeOscilloscope::SetSampleRate(uint64_t rate)
119119
m_transport->SendCommandQueued( string("RATE ") + to_string(rate));
120120
}
121121

122-
123122
void RemoteBridgeOscilloscope::PushTrigger()
124123
{
125124
auto et = dynamic_cast<EdgeTrigger*>(m_trigger);

scopehal/ThunderScopeOscilloscope.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,19 @@ ThunderScopeOscilloscope::ThunderScopeOscilloscope(SCPITransport* transport)
105105
for(size_t i=0; i<4; i++)
106106
DisableChannel(i);
107107

108+
//Set initial memory configuration: 1M point depth @ 1 Gsps
109+
//This must happen before the trigger is configured, since trigger validation depends on knowing memory depth
110+
SetSampleRate(1000000000L);
111+
SetSampleDepth(1000000);
112+
108113
//Configure the trigger
109114
auto trig = new EdgeTrigger(this);
110115
trig->SetType(EdgeTrigger::EDGE_RISING);
111116
trig->SetLevel(0);
112117
trig->SetInput(0, StreamDescriptor(GetOscilloscopeChannel(0)));
113118
SetTrigger(trig);
114-
PushTrigger();
115119
SetTriggerOffset(1000000000); //1us to allow trigphase interpolation
116-
117-
//Set initial memory configuration.
118-
SetSampleRate(1000000000L);
119-
SetSampleDepth(10000);
120+
//don't need a second PushTrigger() call, SetTriggerOffset will implicitly do one
120121

121122
m_diagnosticValues["Hardware WFM/s"] = &m_diag_hardwareWFMHz;
122123
m_diagnosticValues["Received WFM/s"] = &m_diag_receivedWFMHz;

0 commit comments

Comments
 (0)