From 6eb8f524817b3893632d9a651852f1fefe6fcd18 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 16 Jun 2017 16:23:10 +0200 Subject: ir_rc5: Convert to PD API version 3. --- decoders/ir_rc5/pd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'decoders') 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: -- cgit v1.2.3-70-g09d2