* [PATCH v4l-utils] lircd2toml: toggle_bit is offset from bits including pre-data
@ 2019-03-12 22:46 Sean Young
0 siblings, 0 replies; only message in thread
From: Sean Young @ 2019-03-12 22:46 UTC (permalink / raw)
To: linux-media
This causes the following lircd.conf to be converted incorrectly.
http://lirc.sourceforge.net/remotes/cambridge_audio/X40A
Signed-off-by: Sean Young <sean@mess.org>
---
contrib/lircd2toml.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/contrib/lircd2toml.py b/contrib/lircd2toml.py
index f9408ecc..72ee50e3 100755
--- a/contrib/lircd2toml.py
+++ b/contrib/lircd2toml.py
@@ -404,18 +404,18 @@ class Converter:
bits = int(self.remote['bits'][0])
- toggle_bit = 0
- if 'toggle_bit_mask' in self.remote:
- toggle_bit = ffs(int(self.remote['toggle_bit_mask'][0]))
- if 'toggle_bit' in self.remote:
- toggle_bit = bits - int(self.remote['toggle_bit'][0])
-
pre_data = 0
if 'pre_data_bits' in self.remote:
pre_data_bits = int(self.remote['pre_data_bits'][0])
pre_data = int(self.remote['pre_data'][0]) << bits
bits += pre_data_bits
+ toggle_bit = 0
+ if 'toggle_bit_mask' in self.remote:
+ toggle_bit = ffs(int(self.remote['toggle_bit_mask'][0]))
+ if 'toggle_bit' in self.remote:
+ toggle_bit = bits - int(self.remote['toggle_bit'][0])
+
if 'plead' in self.remote:
plead = self.remote['plead'][0]
one_pulse = self.remote['one'][0]
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-03-12 22:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 22:46 [PATCH v4l-utils] lircd2toml: toggle_bit is offset from bits including pre-data Sean Young
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).