srd: Update decoders to changed API.
[libsigrokdecode.git] / decoders / spi.py
index 9c0be9a88bde146da5fe1a9bc9b782e5de1c361a..a363b5afba3c0f53838229435876d83c0450d2e2 100644 (file)
@@ -31,7 +31,7 @@ def sampleiter(data, unitsize):
     for i in range(0, len(data), unitsize):
         yield(Sample(data[i:i+unitsize]))
 
-class Decoder():
+class Decoder(sigrok.Decoder):
     id = 'spi'
     name = 'SPI'
     desc = '...desc...'
@@ -89,12 +89,10 @@ class Decoder():
                 'display':('%02X' % self.rxdata),
                 'type':'spi',
             }
-            sigrok.put(outdata)
+            self.put(outdata)
             # Reset decoder state
             self.rxdata = 0
             self.rxcount = 0
             # Keep stats for summary
             self.bytesreceived += 1
 
-sigrok.register(Decoder)
-