X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fnunchuk%2Fpd.py;h=4f006f2f8f0816546124b288982781eec5cb3f49;hb=4c180223a8ae12feb7bc3601e07e848fb9cdb493;hp=0861cba3574cdbb393fe63cba590f5b7c1adcdb1;hpb=aac0ac249169a8774b30a2f3458a056ae2c80c63;p=libsigrokdecode.git diff --git a/decoders/nunchuk/pd.py b/decoders/nunchuk/pd.py index 0861cba..4f006f2 100644 --- a/decoders/nunchuk/pd.py +++ b/decoders/nunchuk/pd.py @@ -14,14 +14,13 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## along with this program; if not, see . ## import sigrokdecode as srd class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'nunchuk' name = 'Nunchuk' longname = 'Nintendo Wii Nunchuk' @@ -47,7 +46,10 @@ class Decoder(srd.Decoder): ('warnings', 'Warnings', (14,)), ) - def __init__(self, **kwargs): + 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