diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2017-06-16 16:23:10 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2017-06-16 16:23:10 +0200 |
commit | 6eb8f524817b3893632d9a651852f1fefe6fcd18 (patch) | |
tree | 58be09323d76fbfde2b0db8c8cccee4633a4efcb | |
parent | de594dd1322a839636b086c9d9f21bfc12297d1f (diff) | |
download | libsigrokdecode-6eb8f524817b3893632d9a651852f1fefe6fcd18.tar.gz libsigrokdecode-6eb8f524817b3893632d9a651852f1fefe6fcd18.zip |
ir_rc5: Convert to PD API version 3.
-rw-r--r-- | decoders/ir_rc5/pd.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/decoders/ir_rc5/pd.py b/decoders/ir_rc5/pd.py index adf4e06..0b39e70 100644 --- a/decoders/ir_rc5/pd.py +++ b/decoders/ir_rc5/pd.py @@ -24,7 +24,7 @@ class SamplerateError(Exception): pass class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'ir_rc5' name = 'IR RC-5' longname = 'IR RC-5' @@ -134,12 +134,12 @@ class Decoder(srd.Decoder): self.edges, self.bits, self.ss_es_bits = [], [], [] self.state = 'IDLE' - def decode(self, ss, es, data): + def decode(self): if not self.samplerate: raise SamplerateError('Cannot decode without samplerate.') - for (self.samplenum, pins) in data: + while True: - self.ir = pins[0] + (self.ir,) = self.wait({'skip': 1}) # Wait for any edge (rising or falling). if self.old_ir == self.ir: |