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: 716c869a5704
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d4f9f09fb182
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 21, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ce5eb68 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d4f9f09 View commit details
Showing with 22 additions and 10 deletions.
  1. +7 −7 scopehal/ProtocolDecoder.cpp
  2. +13 −3 scopeprotocols/ParallelBusDecoder.cpp
  3. +2 −0 scopeprotocols/ParallelBusDecoder.h
14 changes: 7 additions & 7 deletions scopehal/ProtocolDecoder.cpp
Original file line number Diff line number Diff line change
@@ -221,7 +221,7 @@ bool ProtocolDecoder::IsOverlay()
ProtocolDecoderParameter& ProtocolDecoder::GetParameter(string s)
{
if(m_parameters.find(s) == m_parameters.end())
LogError("Invalid parameter name");
LogError("Invalid parameter name\n");

return m_parameters[s];
}
@@ -237,7 +237,7 @@ string ProtocolDecoder::GetInputName(size_t i)
return m_signalNames[i];
else
{
LogError("Invalid channel index");
LogError("Invalid channel index\n");
return "";
}
}
@@ -253,13 +253,13 @@ void ProtocolDecoder::SetInput(size_t i, OscilloscopeChannel* channel)
}
if(!ValidateChannel(i, channel))
{
LogError("Invalid channel format");
LogError("Invalid channel format\n");
}
m_channels[i] = channel;
}
else
{
LogError("Invalid channel index");
LogError("Invalid channel index\n");
}
}

@@ -276,7 +276,7 @@ void ProtocolDecoder::SetInput(string name, OscilloscopeChannel* channel)
}

//Not found
LogError("Invalid channel name");
LogError("Invalid channel name\n");
}

OscilloscopeChannel* ProtocolDecoder::GetInput(size_t i)
@@ -285,7 +285,7 @@ OscilloscopeChannel* ProtocolDecoder::GetInput(size_t i)
return m_channels[i];
else
{
LogError("Invalid channel index");
LogError("Invalid channel index\n");
return NULL;
}
}
@@ -334,7 +334,7 @@ ProtocolDecoder* ProtocolDecoder::CreateDecoder(string protocol, string color)
if(m_createprocs.find(protocol) != m_createprocs.end())
return m_createprocs[protocol](color);

LogError("Invalid decoder name");
LogError("Invalid decoder name\n");
return NULL;
}

16 changes: 13 additions & 3 deletions scopeprotocols/ParallelBusDecoder.cpp
Original file line number Diff line number Diff line change
@@ -95,17 +95,27 @@ bool ParallelBusDecoder::IsOverlay()
return false;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Serialization

void ParallelBusDecoder::LoadConfiguration(const YAML::Node& node, IDTable& table)
{
ProtocolDecoder::LoadConfiguration(node, table);

m_width = m_parameters[m_widthname].GetIntVal();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Actual decoder logic

void ParallelBusDecoder::Refresh()
{
//Figure out how wide our input is
int width = m_parameters[m_widthname].GetIntVal();
m_width = m_parameters[m_widthname].GetIntVal();

//Make sure we have an input for each channel in use
vector<DigitalCapture*> inputs;
for(int i=0; i<width; i++)
for(int i=0; i<m_width; i++)
{
if(m_channels[i] == NULL)
{
@@ -137,7 +147,7 @@ void ParallelBusDecoder::Refresh()
{
vector<bool> data;
bool end = false;
for(int j=0; j<width; j++)
for(int j=0; j<m_width; j++)
{
if(inputs[j]->GetDepth() <= i)
{
2 changes: 2 additions & 0 deletions scopeprotocols/ParallelBusDecoder.h
Original file line number Diff line number Diff line change
@@ -53,6 +53,8 @@ class ParallelBusDecoder : public ProtocolDecoder

virtual bool ValidateChannel(size_t i, OscilloscopeChannel* channel);

virtual void LoadConfiguration(const YAML::Node& node, IDTable& table);

PROTOCOL_DECODER_INITPROC(ParallelBusDecoder)

protected: