summaryrefslogtreecommitdiff
path: root/decoders/nunchuk
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2015-08-21 14:50:04 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2015-08-21 14:50:04 +0200
commitaac0ac249169a8774b30a2f3458a056ae2c80c63 (patch)
tree8c8889c50c01ae99c3afe7b6e5f0f7c190692ace /decoders/nunchuk
parentcda2d36cfeed3f921252ffa95377529d6bdc074b (diff)
downloadlibsigrokdecode-aac0ac249169a8774b30a2f3458a056ae2c80c63.tar.gz
libsigrokdecode-aac0ac249169a8774b30a2f3458a056ae2c80c63.zip
nunchuk: Fix inverted button press logic.
The buttons are pressed if the respective bit is 0.
Diffstat (limited to 'decoders/nunchuk')
-rw-r--r--decoders/nunchuk/pd.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/decoders/nunchuk/pd.py b/decoders/nunchuk/pd.py
index afcf1de..0861cba 100644
--- a/decoders/nunchuk/pd.py
+++ b/decoders/nunchuk/pd.py
@@ -128,8 +128,8 @@ class Decoder(srd.Decoder):
t = (self.sx, self.sy, self.ax, self.ay, self.az, self.bz, self.bc)
if -1 in t:
return
- bz = 'pressed' if self.bz == 1 else 'not pressed'
- bc = 'pressed' if self.bc == 1 else 'not pressed'
+ bz = 'pressed' if self.bz == 0 else 'not pressed'
+ bc = 'pressed' if self.bc == 0 else 'not pressed'
s = 'Analog stick: %d/%d, accelerometer: %d/%d/%d, Z: %s, C: %s' % \
(self.sx, self.sy, self.ax, self.ay, self.az, bz, bc)
self.putb([13, [s]])