diff options
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/timing/pd.py | 10 |
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 |