diff options
author | Gerhard Sittig <gerhard.sittig@gmx.net> | 2017-02-20 21:37:05 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2017-12-22 12:21:54 +0100 |
commit | 10aeb8ea8b183394cebc0033f048f49f4262b57d (patch) | |
tree | f58f049342dd6fce239514ed5dfffdbc573e3ce1 /decoders/i2cdemux/pd.py | |
parent | ecb0b96d4a4d0021b41ffebec0df219338aa3724 (diff) | |
download | libsigrokdecode-10aeb8ea8b183394cebc0033f048f49f4262b57d.tar.gz libsigrokdecode-10aeb8ea8b183394cebc0033f048f49f4262b57d.zip |
all decoders: introduce a reset() method
Move initialization code of protocol decoders from the constructor to a
new reset() helper method. The libsigrokdecode backend could run this
method several times to clear the decoder's internal state, before new
data from another acquisition gets fed to decode() calls.
Diffstat (limited to 'decoders/i2cdemux/pd.py')
-rw-r--r-- | decoders/i2cdemux/pd.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/decoders/i2cdemux/pd.py b/decoders/i2cdemux/pd.py index c6ab53d..2495e84 100644 --- a/decoders/i2cdemux/pd.py +++ b/decoders/i2cdemux/pd.py @@ -30,6 +30,9 @@ class Decoder(srd.Decoder): outputs = [] # TODO: Only known at run-time. 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 |