Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e2f9d6a3c5af
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 14ea14cd1eb1
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 17, 2021

  1. Copy the full SHA
    14ea14c View commit details
Showing with 6 additions and 13 deletions.
  1. +6 −13 scopehal/PicoOscilloscope.cpp
19 changes: 6 additions & 13 deletions scopehal/PicoOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -136,6 +136,7 @@ PicoOscilloscope::PicoOscilloscope(SCPITransport* transport)
trig->SetInput(0, StreamDescriptor(m_channels[0]));
SetTrigger(trig);
PushTrigger();
SetTriggerOffset(10 * 1000L * 1000L);

//For now, assume control plane port is data plane +1
LogDebug("Connecting to data plane socket\n");
@@ -705,10 +706,6 @@ void PicoOscilloscope::SetSampleDepth(uint64_t depth)
lock_guard<recursive_mutex> lock(m_mutex);
m_transport->SendCommand(string("DEPTH ") + to_string(depth));
m_mdepth = depth;

//FIXME: set trigger delay
int64_t fs_per_sample = FS_PER_SECOND / m_srate;
m_triggerOffset = fs_per_sample * m_mdepth/2;
}

void PicoOscilloscope::SetSampleRate(uint64_t rate)
@@ -717,21 +714,17 @@ void PicoOscilloscope::SetSampleRate(uint64_t rate)

lock_guard<recursive_mutex> lock(m_mutex);
m_transport->SendCommand( string("RATE ") + to_string(rate));

//FIXME: set trigger delay
int64_t fs_per_sample = FS_PER_SECOND / m_srate;
m_triggerOffset = fs_per_sample * m_mdepth/2;
}

void PicoOscilloscope::SetTriggerOffset(int64_t offset)
{
lock_guard<recursive_mutex> lock(m_mutex);
m_triggerOffset = offset;
PushTrigger();

//FIXME: set trigger delay
int64_t fs_per_sample = FS_PER_SECOND / m_srate;
m_triggerOffset = fs_per_sample * m_mdepth/2;
//Don't allow setting trigger offset beyond the end of the capture
int64_t captureDuration = GetSampleDepth() * FS_PER_SECOND / GetSampleRate();
m_triggerOffset = min(offset, captureDuration);

PushTrigger();
}

int64_t PicoOscilloscope::GetTriggerOffset()