From: Uwe Hermann Date: Fri, 16 Jun 2017 14:23:10 +0000 (+0200) Subject: ir_rc5: Convert to PD API version 3. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6eb8f524817b3893632d9a651852f1fefe6fcd18;p=libsigrokdecode.git ir_rc5: Convert to PD API version 3. --- 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: