From: Uwe Hermann Date: Fri, 16 Jun 2017 14:22:57 +0000 (+0200) Subject: dsi: Convert to PD API version 3. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=de594dd1322a839636b086c9d9f21bfc12297d1f;p=libsigrokdecode.git dsi: Convert to PD API version 3. --- diff --git a/decoders/dsi/pd.py b/decoders/dsi/pd.py index d049b9c..35a1225 100644 --- a/decoders/dsi/pd.py +++ b/decoders/dsi/pd.py @@ -23,7 +23,7 @@ class SamplerateError(Exception): pass class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'dsi' name = 'DSI' longname = 'Digital Serial Interface' @@ -103,12 +103,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.') bit = 0 - for (self.samplenum, pins) in data: - self.dsi = pins[0] + while True: + (self.dsi,) = self.wait({'skip': 1}) if self.options['polarity'] == 'active-high': self.dsi ^= 1 # Invert.