From: Sean Young <sean@mess.org>
To: linux-media@vger.kernel.org
Subject: [PATCH v4l-utils] ir-ctl: rc5 command 6th bit missing
Date: Mon, 12 Dec 2016 11:46:46 +0000 [thread overview]
Message-ID: <1481543206-8696-1-git-send-email-sean@mess.org> (raw)
This is called extended rc5, not be confused with rc5x_20.
Signed-off-by: Sean Young <sean@mess.org>
---
utils/ir-ctl/ir-encode.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/utils/ir-ctl/ir-encode.c b/utils/ir-ctl/ir-encode.c
index 9cc8c5d..3863779 100644
--- a/utils/ir-ctl/ir-encode.c
+++ b/utils/ir-ctl/ir-encode.c
@@ -250,7 +250,8 @@ static int rc5_encode(enum rc_proto proto, unsigned scancode, unsigned *buf)
default:
return 0;
case RC_PROTO_RC5:
- add_bits(2, 2);
+ add_bits(!(scancode & 0x40), 1);
+ add_bits(0, 1);
add_bits(scancode >> 8, 5);
add_bits(scancode, 6);
break;
@@ -349,7 +350,7 @@ static const struct {
unsigned carrier;
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_RC5] = { "rc5", 0x1f7f, 24, 36000, rc5_encode },
[RC_PROTO_RC5X_20] = { "rc5x_20", 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 },
--
2.1.4
reply other threads:[~2016-12-12 11:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1481543206-8696-1-git-send-email-sean@mess.org \
--to=sean@mess.org \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).