diff options
author | Kristoffer Sjöberg <ksjoberg@q1.se> | 2011-11-12 23:42:52 +0100 |
---|---|---|
committer | Gareth McMullin <gareth@blacksphere.co.nz> | 2011-11-20 16:31:47 +1300 |
commit | 922763abc279fc5d4e0ed93ed6c6bebbf68d7baf (patch) | |
tree | 40a9f53b3284c8d245c7c5ec35328f775e272074 /decoders/nunchuk.py | |
parent | 7c3d8112204315d717b85bc4c71ecbf3ccf54f51 (diff) | |
download | libsigrokdecode-922763abc279fc5d4e0ed93ed6c6bebbf68d7baf.tar.gz libsigrokdecode-922763abc279fc5d4e0ed93ed6c6bebbf68d7baf.zip |
Partial implementation of the streaming PD API.
Diffstat (limited to 'decoders/nunchuk.py')
-rw-r--r-- | decoders/nunchuk.py | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/decoders/nunchuk.py b/decoders/nunchuk.py index 77b154e..57be1d7 100644 --- a/decoders/nunchuk.py +++ b/decoders/nunchuk.py @@ -47,7 +47,12 @@ example_packets = [ {'type': 'P', 'range': (32, 33), 'data': None, 'ann': ''}, ] -def decode(inbuf): +def decode(l): + print(l) + sigrok.put(l) + + +def decode2(inbuf): """Nintendo Wii Nunchuk decoder""" # FIXME: Get the data in the correct format in the first place. @@ -139,27 +144,26 @@ def decode(inbuf): # FIXME return '' -def register(): - return { - 'id': 'nunchuk', - 'name': 'Nunchuk', - 'longname': 'Nintendo Wii Nunchuk decoder', - 'desc': 'Decodes the Nintendo Wii Nunchuk I2C-based protocol.', - 'longdesc': '...', - 'author': 'Uwe Hermann', - 'email': 'uwe@hermann-uwe.de', - 'license': 'gplv2+', - 'in': ['i2c'], - 'out': ['nunchuck'], - 'probes': [ - # TODO - ], - 'options': { - # TODO - }, - # 'start': start, - # 'report': report, - } +register = { + 'id': 'nunchuk', + 'name': 'Nunchuk', + 'longname': 'Nintendo Wii Nunchuk decoder', + 'desc': 'Decodes the Nintendo Wii Nunchuk I2C-based protocol.', + 'longdesc': '...', + 'author': 'Uwe Hermann', + 'email': 'uwe@hermann-uwe.de', + 'license': 'gplv2+', + 'in': ['i2c'], + 'out': ['nunchuck'], + 'probes': [ + # TODO + ], + 'options': { + # TODO + }, + # 'start': start, + # 'report': report, +} # Use psyco (if available) as it results in huge performance improvements. try: |