From 486b19ce017c6663be6574dacd0c823304903bca Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Mon, 13 Oct 2014 17:05:07 +0200 Subject: All PDs: More consistent names for ss/es variables. Use self.ss/self.es, or if there's a need to differentiate them a bit more, use self.ss_/self.es_ consistently. Also, drop some unused variables. --- decoders/i2c/pd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'decoders/i2c/pd.py') diff --git a/decoders/i2c/pd.py b/decoders/i2c/pd.py index 0408c7d..ce0d699 100644 --- a/decoders/i2c/pd.py +++ b/decoders/i2c/pd.py @@ -110,7 +110,7 @@ class Decoder(srd.Decoder): def __init__(self, **kwargs): self.samplerate = None - self.ss = self.es = self.byte_ss = -1 + self.ss = self.es = self.ss_byte = -1 self.samplenum = None self.bitcount = 0 self.databyte = 0 @@ -182,7 +182,7 @@ class Decoder(srd.Decoder): # Remember the start of the first data/address bit. if self.bitcount == 0: - self.byte_ss = self.samplenum + self.ss_byte = self.samplenum # Store individual bits and their start/end samplenumbers. # In the list, index 0 represents the LSB (I²C transmits MSB-first). @@ -219,7 +219,7 @@ class Decoder(srd.Decoder): cmd = 'DATA READ' bin_class = 2 - self.ss, self.es = self.byte_ss, self.samplenum + self.bitwidth + self.ss, self.es = self.ss_byte, self.samplenum + self.bitwidth self.putp(['BITS', self.bits]) self.putp([cmd, d]) @@ -233,7 +233,7 @@ class Decoder(srd.Decoder): self.ss, self.es = self.samplenum, self.samplenum + self.bitwidth w = ['Write', 'Wr', 'W'] if self.wr else ['Read', 'Rd', 'R'] self.putx([proto[cmd][0], w]) - self.ss, self.es = self.byte_ss, self.samplenum + self.ss, self.es = self.ss_byte, self.samplenum self.putx([proto[cmd][0], ['%s: %02X' % (proto[cmd][1], d), '%s: %02X' % (proto[cmd][2], d), '%02X' % d]]) @@ -256,7 +256,7 @@ class Decoder(srd.Decoder): # Meta bitrate elapsed = 1 / float(self.samplerate) * (self.samplenum - self.pdu_start + 1) bitrate = int(1 / elapsed * self.pdu_bits) - self.put(self.byte_ss, self.samplenum, self.out_bitrate, bitrate) + self.put(self.ss_byte, self.samplenum, self.out_bitrate, bitrate) cmd = 'STOP' self.ss, self.es = self.samplenum, self.samplenum -- cgit v1.2.3-70-g09d2