From 831e976a72a74dfa71548091b4fa401713d74052 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 26 Aug 2016 15:21:03 +0200 Subject: timing: Convert to PD API version 3. --- decoders/timing/pd.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'decoders') diff --git a/decoders/timing/pd.py b/decoders/timing/pd.py index 98677b9..64ba566 100644 --- a/decoders/timing/pd.py +++ b/decoders/timing/pd.py @@ -47,7 +47,7 @@ def normalize_time(t): return '%f' % t class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'timing' name = 'Timing' longname = 'Timing calculation with frequency and averaging' @@ -83,12 +83,14 @@ class Decoder(srd.Decoder): def start(self): self.out_ann = self.register(srd.OUTPUT_ANN) + self.initial_pins = [0] - def decode(self, ss, es, data): + def decode(self): if not self.samplerate: raise SamplerateError('Cannot decode without samplerate.') + while True: + pin = self.wait({0: 'e'}) - for (self.samplenum, (pin,)) in data: if self.oldpin is None: self.oldpin = pin self.last_samplenum = self.samplenum -- cgit v1.2.3-70-g09d2