]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/nunchuk/pd.py
counter: add support for user specified initial counter values
[libsigrokdecode.git] / decoders / nunchuk / pd.py
index 6a6b4e9613f7873b6dfb64c3632ecf93272d208d..4f006f2f8f0816546124b288982781eec5cb3f49 100644 (file)
@@ -20,7 +20,7 @@
 import sigrokdecode as srd
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'nunchuk'
     name = 'Nunchuk'
     longname = 'Nintendo Wii Nunchuk'
@@ -47,6 +47,9 @@ class Decoder(srd.Decoder):
     )
 
     def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.state = 'IDLE'
         self.sx = self.sy = self.ax = self.ay = self.az = self.bz = self.bc = -1
         self.databytecount = 0