summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2016-04-20 19:31:21 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2016-04-20 19:31:21 +0200
commit963d71d5527c9c1cf16bb8d5fbeed2d452ffd5c0 (patch)
tree165a31a87f4829d42946e02d837efbdc5fe7275d /decoders
parente96593c1e2e614d3b08076d4f7318ef388e35a9d (diff)
downloadlibsigrokdecode-963d71d5527c9c1cf16bb8d5fbeed2d452ffd5c0.tar.gz
libsigrokdecode-963d71d5527c9c1cf16bb8d5fbeed2d452ffd5c0.zip
timing: Use self.samplenum for consistency across PDs.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/timing/pd.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/decoders/timing/pd.py b/decoders/timing/pd.py
index 6bca120..5e2aaa7 100644
--- a/decoders/timing/pd.py
+++ b/decoders/timing/pd.py
@@ -71,24 +71,24 @@ class Decoder(srd.Decoder):
if not self.samplerate:
raise SamplerateError('Cannot decode without samplerate.')
- for (samplenum, (pin,)) in data:
+ for (self.samplenum, (pin,)) in data:
# Ignore identical samples early on (for performance reasons).
if self.oldpin == pin:
continue
if self.oldpin is None:
self.oldpin = pin
- self.last_samplenum = samplenum
+ self.last_samplenum = self.samplenum
continue
if self.oldpin != pin:
- samples = samplenum - self.last_samplenum
+ samples = self.samplenum - self.last_samplenum
t = samples / self.samplerate
# Report the timing normalized.
- self.put(self.last_samplenum, samplenum, self.out_ann,
+ self.put(self.last_samplenum, self.samplenum, self.out_ann,
[0, [normalize_time(t)]])
# Store data for next round.
- self.last_samplenum = samplenum
+ self.last_samplenum = self.samplenum
self.oldpin = pin