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

Commits on Nov 24, 2020

  1. Copy the full SHA
    107801a View commit details
Showing with 8 additions and 3 deletions.
  1. +8 −3 scopeprotocols/USB2PacketDecoder.cpp
11 changes: 8 additions & 3 deletions scopeprotocols/USB2PacketDecoder.cpp
Original file line number Diff line number Diff line change
@@ -671,7 +671,10 @@ void USB2PacketDecoder::DecodeData(USB2PacketWaveform* cap, size_t istart, size_
return;
}
if(scrc.m_type != USB2PacketSymbol::TYPE_CRC5_GOOD)
{
LogDebug("bad CRC\n");
return;
}

//Expect minimum DATA, 0 or more data bytes, ACK
if(i >= cap->m_samples.size())
@@ -713,6 +716,9 @@ void USB2PacketDecoder::DecodeData(USB2PacketWaveform* cap, size_t istart, size_
pack->m_headers["Endpoint"] = tmp;
pack->m_headers["Details"] = "NAK";
m_packets.push_back(pack);

pack->m_len = ((cap->m_offsets[i] + cap->m_durations[i]) * cap->m_timescale) - pack->m_offset;

return;
}
else //normal data
@@ -749,10 +755,7 @@ void USB2PacketDecoder::DecodeData(USB2PacketWaveform* cap, size_t istart, size_

//Keep adding data
if(s.m_type == USB2PacketSymbol::TYPE_DATA)
{
pack->m_data.push_back(s.m_data);
pack->m_len = ((cap->m_offsets[i] + cap->m_durations[i]) * cap->m_timescale) - pack->m_offset;
}

//Next should be a CRC16
else if(s.m_type == USB2PacketSymbol::TYPE_CRC16_GOOD)
@@ -786,6 +789,8 @@ void USB2PacketDecoder::DecodeData(USB2PacketWaveform* cap, size_t istart, size_
ack = "Not a PID";
}

pack->m_len = ((cap->m_offsets[i] + cap->m_durations[i]) * cap->m_timescale) - pack->m_offset;

//Format the data
string details = "";
for(auto b : pack->m_data)