]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/microwire/pd.py
microwire: introduce constructor and reset() method
[libsigrokdecode.git] / decoders / microwire / pd.py
index b8b18e8a2e57651963b3b89dc533b511e58f84e7..4180ba2f318b1e3f661b72662a87c25379fc4a96 100644 (file)
@@ -25,7 +25,7 @@ OUTPUT_PYTHON format:
 
 Packet:
 [namedtuple('ss': bit start sample number,
-  'se': bit end sample number,
+  'es': bit end sample number,
   'si': SI bit,
   'so': SO bit,
  ), ...]
@@ -38,7 +38,7 @@ To be able to annotate correctly the instructions formed by the bit, the start
 and end sample number of each bit (pair of SI/SO bit) are provided.
 '''
 
-PyPacket = namedtuple('PyPacket', 'ss se si so')
+PyPacket = namedtuple('PyPacket', 'ss es si so')
 Packet = namedtuple('Packet', 'samplenum matched cs sk si so')
 
 class Decoder(srd.Decoder):
@@ -71,6 +71,12 @@ class Decoder(srd.Decoder):
         ('warnings', 'Warnings', (5,)),
     )
 
+    def __init__(self):
+        self.reset()
+
+    def reset(self):
+        pass
+
     def start(self):
         self.out_python = self.register(srd.OUTPUT_PYTHON)
         self.out_ann = self.register(srd.OUTPUT_ANN)