From 10aeb8ea8b183394cebc0033f048f49f4262b57d Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Mon, 20 Feb 2017 21:37:05 +0100 Subject: 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. --- decoders/ssi32/pd.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'decoders/ssi32') diff --git a/decoders/ssi32/pd.py b/decoders/ssi32/pd.py index dbcdf64..f2685e2 100644 --- a/decoders/ssi32/pd.py +++ b/decoders/ssi32/pd.py @@ -46,6 +46,9 @@ class Decoder(srd.Decoder): ) def __init__(self): + self.reset() + + def reset(self): self.ss_cmd, self.es_cmd = 0, 0 self.mosi_bytes = [] self.miso_bytes = [] -- cgit v1.2.3-70-g09d2