X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Flpc%2Fpd.py;h=cdd1db8f4e6d25f696887adbe0893794453809b8;hb=1b9ef18be867133e721681cbc20272cf5c669504;hp=5e25db4779ba886070fecd752ecf848926eec966;hpb=35b380b1156434b73d4a976c68f5ab3604c8510a;p=libsigrokdecode.git diff --git a/decoders/lpc/pd.py b/decoders/lpc/pd.py index 5e25db4..cdd1db8 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' @@ -136,7 +135,7 @@ class Decoder(srd.Decoder): ('warnings', 'Warnings', (0,)), ) - def __init__(self, **kwargs): + def __init__(self): self.state = 'IDLE' self.oldlclk = -1 self.samplenum = 0 @@ -313,8 +312,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: