Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH v4l-utils 2/6] ir-ctl: fix rc5x encoding
@ 2016-12-02 17:20 Sean Young
  0 siblings, 0 replies; only message in thread
From: Sean Young @ 2016-12-02 17:20 UTC (permalink / raw)
  To: linux-media

6th command bit was missing.

Signed-off-by: Sean Young <sean@mess.org>
---
 utils/ir-ctl/ir-encode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/ir-ctl/ir-encode.c b/utils/ir-ctl/ir-encode.c
index 1bf0ac6..704ce95 100644
--- a/utils/ir-ctl/ir-encode.c
+++ b/utils/ir-ctl/ir-encode.c
@@ -261,7 +261,7 @@ static int rc5_encode(enum rc_proto proto, unsigned scancode, unsigned *buf)
 		add_bits(scancode, 6);
 		break;
 	case RC_PROTO_RC5X:
-		add_bits(!!(scancode & 0x4000), 1);
+		add_bits(!(scancode & 0x4000), 1);
 		add_bits(0, 1);
 		add_bits(scancode >> 16, 5);
 		advance_space(NS_TO_US(rc5_unit * 4));
@@ -350,7 +350,7 @@ static const struct {
 	int (*encode)(enum rc_proto proto, unsigned scancode, unsigned *buf);
 } encoders[RC_PROTO_COUNT] = {
 	[RC_PROTO_RC5] = { "rc5", 0x1f3f, 24, 36000, rc5_encode },
-	[RC_PROTO_RC5X] = { "rc5x", 0x1f3f3f, 40, 36000, rc5_encode },
+	[RC_PROTO_RC5X] = { "rc5x", 0x1f7f3f, 40, 36000, rc5_encode },
 	[RC_PROTO_RC5_SZ] = { "rc5_sz", 0x2fff, 26, 36000, rc5_encode },
 	[RC_PROTO_SONY12] = { "sony12", 0x1f007f, 25, 40000, sony_encode },
 	[RC_PROTO_SONY15] = { "sony15", 0xff007f, 31, 40000, sony_encode },
-- 
2.9.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-02 17:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-02 17:20 [PATCH v4l-utils 2/6] ir-ctl: fix rc5x encoding Sean Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox