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: b4df60c38917
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f52eee682f26
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 12, 2020

  1. Copy the full SHA
    f52eee6 View commit details
Showing with 26 additions and 12 deletions.
  1. +26 −12 scopeprotocols/SDDataDecoder.cpp
38 changes: 26 additions & 12 deletions scopeprotocols/SDDataDecoder.cpp
Original file line number Diff line number Diff line change
@@ -182,9 +182,12 @@ void SDDataDecoder::Refresh()
auto cmd_packet = FindCommandBusPacket(cmdbus, d0.m_offsets[i]);

//If it's the same as our last packet, or doesn't exist, don't make a new packet
if( (cmd_packet == last_cmdbus_packet) || (cmd_packet == NULL) )
if(cmd_packet == NULL)
pack = NULL;

else if(cmd_packet == last_cmdbus_packet)
{}

//New packet, process stuff
else
{
@@ -215,19 +218,26 @@ void SDDataDecoder::Refresh()
break;

case STATE_DATA_LOW:
cap->m_offsets.push_back(data_start);
cap->m_durations.push_back(d0.m_offsets[i] + d0.m_durations[i] - data_start);
cap->m_samples.push_back(SDDataSymbol(SDDataSymbol::TYPE_DATA, high_val | cur_data));
{
uint8_t data = high_val | cur_data;

bytes_left --;
cap->m_offsets.push_back(data_start);
cap->m_durations.push_back(d0.m_offsets[i] + d0.m_durations[i] - data_start);
cap->m_samples.push_back(SDDataSymbol(SDDataSymbol::TYPE_DATA, data));

if(bytes_left > 0)
state = STATE_DATA_HIGH;
else
{
data_start = d0.m_offsets[i] + d0.m_durations[i];
state = STATE_CRC;
bytes_left = 16;
if(pack)
pack->m_data.push_back(data);

bytes_left --;

if(bytes_left > 0)
state = STATE_DATA_HIGH;
else
{
data_start = d0.m_offsets[i] + d0.m_durations[i];
state = STATE_CRC;
bytes_left = 16;
}
}
break;

@@ -252,6 +262,10 @@ void SDDataDecoder::Refresh()
cap->m_durations.push_back(d0.m_durations[i]);
cap->m_samples.push_back(SDDataSymbol(SDDataSymbol::TYPE_END, 0));
state = STATE_IDLE;

if(pack)
pack->m_len = d0.m_offsets[i] + d0.m_durations[i] - pack->m_offset;

break;

default: