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

Commits on Sep 23, 2020

  1. Copy the full SHA
    d80b301 View commit details
Showing with 11 additions and 6 deletions.
  1. +11 −6 scopeprotocols/I2CEepromDecoder.cpp
17 changes: 11 additions & 6 deletions scopeprotocols/I2CEepromDecoder.cpp
Original file line number Diff line number Diff line change
@@ -150,8 +150,6 @@ void I2CEepromDecoder::Refresh()
if(raw_bits > 16)
device_bits = raw_bits - 16;
int pointer_bits = min(16, raw_bits);
LogDebug("Base address is 0x%02x\n", base_addr);
LogDebug("%d device bits, %d pointer bits\n", device_bits, pointer_bits);

//Set up output
auto cap = new I2CEepromWaveform;
@@ -241,11 +239,16 @@ void I2CEepromDecoder::Refresh()
//Expect ACK/NAK then move on
else
{
//TODO: offset if device_bits is nonzero
//Offset left if device_bits is nonzero
size_t ui = (din->m_durations[i]) / 8;
end -= device_bits * ui;

cap->m_offsets.push_back(tstart);
cap->m_durations.push_back(end - tstart);
cap->m_samples.push_back(I2CEepromSymbol(I2CEepromSymbol::TYPE_SELECT_READ, 0));
state = 2;

tstart = end;
}
}
else
@@ -257,11 +260,13 @@ void I2CEepromDecoder::Refresh()
case 2:
if(s.m_stype == I2CSymbol::TYPE_ACK)
{
//Extend the address sample if no device bits
//Extend the address sample as needed
size_t nlast = cap->m_offsets.size() - 1;
if(device_bits == 0)
cap->m_durations[nlast] = end - tstart;
tstart = end;
{
cap->m_durations[nlast] += din->m_durations[i];
tstart += din->m_durations[i];
}

//Move on to the memory address
state = 3;