X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fir_rc5%2Fpd.py;h=0b39e709698f935610fa30d475b35c42b8ee0ff4;hb=6eb8f524817b3893632d9a651852f1fefe6fcd18;hp=ae20d3a70d11911ce7c7b615e8add19c2f065c75;hpb=92b7b49f6964f57a7d6fc4473645c993cfa4ba52;p=libsigrokdecode.git diff --git a/decoders/ir_rc5/pd.py b/decoders/ir_rc5/pd.py index ae20d3a..0b39e70 100644 --- a/decoders/ir_rc5/pd.py +++ b/decoders/ir_rc5/pd.py @@ -14,8 +14,7 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## along with this program; if not, see . ## import sigrokdecode as srd @@ -25,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' @@ -135,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: