X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fi2cdemux%2Fpd.py;h=2495e84931a3a42d0af015672d154bd32fd46d5e;hp=12ebb88447097903d69b7dab6ad03b6634e125aa;hb=10aeb8ea8b183394cebc0033f048f49f4262b57d;hpb=c515eed7ef7a04a42b5b34abd308e08d6942835e diff --git a/decoders/i2cdemux/pd.py b/decoders/i2cdemux/pd.py index 12ebb88..2495e84 100644 --- a/decoders/i2cdemux/pd.py +++ b/decoders/i2cdemux/pd.py @@ -14,14 +14,13 @@ ## 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 class Decoder(srd.Decoder): - api_version = 1 + api_version = 3 id = 'i2cdemux' name = 'I²C demux' longname = 'I²C demultiplexer' @@ -29,12 +28,11 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['i2c'] outputs = [] # TODO: Only known at run-time. - probes = [] - optional_probes = [] - options = {} - annotations = [] - def __init__(self, **kwargs): + def __init__(self): + self.reset() + + def reset(self): self.packets = [] # Local cache of I²C packets self.slaves = [] # List of known slave addresses self.stream = -1 # Current output stream @@ -79,4 +77,3 @@ class Decoder(srd.Decoder): self.stream = -1 else: pass # Do nothing, only add the I²C packet to our cache. -