]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/mx25lxx05d.py
srd: Drop useless out_ann/out_proto init.
[libsigrokdecode.git] / decoders / mx25lxx05d.py
index 0f2f73b8cbcbe43eeab62ef986a60874bef4953b..4a87fa4b4b57476978936527f9244cd04cdfb54d 100644 (file)
@@ -30,7 +30,7 @@
 # http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/3F21BAC2E121E17848257639003A3146/$File/MX25L1605D-3205D-6405D-1.5.pdf
 #
 
-import sigrokdecode
+import sigrokdecode as srd
 
 # States
 IDLE = -1
@@ -157,7 +157,7 @@ miso_packets = [
     {'type': 'D',  'range': (10, 11), 'data': 0xff, 'ann': ''},
 ]
 
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
     id = 'mx25lxx05d'
     name = 'Macronix MX25Lxx05D'
     longname = 'Macronix MX25Lxx05D SPI flash chip decoder'
@@ -172,15 +172,13 @@ class Decoder(sigrokdecode.Decoder):
     options = {} # TODO
 
     def __init__(self, **kwargs):
-        self.output_protocol = None
-        self.output_annotation = None
         self.state = IDLE
         self.cmdstate = 1 # TODO
         self.out = []
 
     def start(self, metadata):
-        # self.output_protocol = self.output_new(2)
-        self.output_annotation = self.output_new(1)
+        # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'mx25lxx05d')
+        self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'mx25lxx05d')
 
     def report(self):
         pass
@@ -351,6 +349,6 @@ class Decoder(sigrokdecode.Decoder):
                 pass
 
         if self.out != []:
-            # self.put(0, 0, self.output_protocol, out_proto)
-            self.put(0, 0, self.output_annotation, self.out)
+            # self.put(0, 0, self.out_proto, out_proto)
+            self.put(0, 0, self.out_ann, self.out)