X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Flpc%2Fpd.py;h=08d0437affe9c04015ab2cfad40eea83cfe00364;hb=6120ff64d4096bcb32c8a42f06ff77d75a5326c2;hp=936839442346a5b609d87c11b88347a2c6798205;hpb=92b7b49f6964f57a7d6fc4473645c993cfa4ba52;p=libsigrokdecode.git diff --git a/decoders/lpc/pd.py b/decoders/lpc/pd.py index 9368394..08d0437 100644 --- a/decoders/lpc/pd.py +++ b/decoders/lpc/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 @@ -96,7 +95,7 @@ fields = { } class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'lpc' name = 'LPC' longname = 'Low-Pin-Count' @@ -140,7 +139,6 @@ class Decoder(srd.Decoder): self.state = 'IDLE' self.oldlclk = -1 self.samplenum = 0 - self.clocknum = 0 self.lad = -1 self.addr = 0 self.cur_nibble = 0 @@ -313,8 +311,10 @@ class Decoder(srd.Decoder): self.tarcount = 0 self.state = 'IDLE' - def decode(self, ss, es, data): - for (self.samplenum, pins) in data: + def decode(self): + while True: + # TODO: Come up with more appropriate self.wait() conditions. + pins = self.wait() # If none of the pins changed, there's nothing to do. if self.oldpins == pins: @@ -350,7 +350,6 @@ class Decoder(srd.Decoder): self.ss_block = self.samplenum self.state = 'GET START' self.lad = -1 - # self.clocknum = 0 elif self.state == 'GET START': self.handle_get_start(lad, lad_bits, lframe) elif self.state == 'GET CT/DR':