X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fi2cfilter%2Fpd.py;h=3c02a2e40ec46aabc115f4b4ed94ac3fc81e01a6;hb=1a782fad8a1e8addeb1f27e221b286ffe2b2e30a;hp=f1ac6a40211c9f4a3e2ababc63737a4b6975e7f6;hpb=12851357e784b893e24880efc6cd22a0cbcc64ce;p=libsigrokdecode.git diff --git a/decoders/i2cfilter/pd.py b/decoders/i2cfilter/pd.py index f1ac6a4..3c02a2e 100644 --- a/decoders/i2cfilter/pd.py +++ b/decoders/i2cfilter/pd.py @@ -39,7 +39,6 @@ class Decoder(srd.Decoder): ) def __init__(self, **kwargs): - self.state = None self.curslave = -1 self.curdirection = None self.packets = [] # Local cache of I²C packets @@ -48,8 +47,6 @@ class Decoder(srd.Decoder): self.out_python = self.register(srd.OUTPUT_PYTHON, proto_id='i2c') if self.options['address'] not in range(0, 127 + 1): raise Exception('Invalid slave (must be 0..127).') - if self.options['direction'] not in ('both', 'read', 'write'): - raise Exception('Invalid direction (valid: read/write/both).') # Grab I²C packets into a local cache, until an I²C STOP condition # packet comes along. At some point before that STOP condition, there @@ -90,4 +87,3 @@ class Decoder(srd.Decoder): self.packets = [] else: pass # Do nothing, only add the I²C packet to our cache. -