diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2016-08-26 15:21:03 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2016-12-07 22:45:47 +0100 |
commit | 831e976a72a74dfa71548091b4fa401713d74052 (patch) | |
tree | 41cdcbd8c7e58d7bb386a8e9bb86b6ba30ae92e6 /decoders | |
parent | e809f7bc100f2d67bc45f35ce8fc3f01dc6684c0 (diff) | |
download | libsigrokdecode-831e976a72a74dfa71548091b4fa401713d74052.tar.gz libsigrokdecode-831e976a72a74dfa71548091b4fa401713d74052.zip |
timing: Convert to PD API version 3.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/timing/pd.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 |