From 4180cba9a51acd32f69f0f8628bb746ea3e12be6 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 31 Mar 2012 17:04:50 +0200 Subject: srd: Decoders: Fix/simplify samplenum usage. --- decoders/spi/spi.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'decoders/spi') diff --git a/decoders/spi/spi.py b/decoders/spi/spi.py index a2ae86f..5e5e74e 100644 --- a/decoders/spi/spi.py +++ b/decoders/spi/spi.py @@ -83,9 +83,7 @@ class Decoder(srd.Decoder): def decode(self, ss, es, data): # TODO: Either MISO or MOSI could be optional. CS# is optional. - for (samplenum, (miso, mosi, sck, cs)) in data: - - self.samplenum += 1 # FIXME + for (self.samplenum, (miso, mosi, sck, cs)) in data: # Ignore sample if the clock pin hasn't changed. if sck == self.oldsck: @@ -106,7 +104,7 @@ class Decoder(srd.Decoder): # If this is the first bit, save its sample number. if self.bitcount == 0: - self.start_sample = samplenum + self.start_sample = self.samplenum active_low = (self.options['cs_polarity'] == 'active-low') deasserted = cs if active_low else not cs if deasserted: -- cgit v1.2.3-70-g09d2