Skip to contentSkip to conversation

nec-decoder: fix NEC decoding for Pioneer Laserdisc CU-700 remote

PATCH In review Sean Young 2 participants 2 messages Jul 31, 2012 – Aug 11, 2012

Subsystems (2)
lore
Share & tools
lore

Sean Young

author maintainer
#0 lore raw

PATCH 1/1 nec-decoder: fix NEC decoding for Pioneer Laserdisc CU-700 remote

This remote sends a header pulse of 8150us followed by a space of 4000us.

---
 drivers/media/rc/ir-nec-decoder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/rc/ir-nec-decoder.c +2 -2
index 3c9431a..2ca509e 100644
@@ -70,7 +70,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
 		if (!ev.pulse)
 			break;
 
-		if (eq_margin(ev.duration, NEC_HEADER_PULSE, NEC_UNIT / 2)) {
+		if (eq_margin(ev.duration, NEC_HEADER_PULSE, NEC_UNIT * 2)) {
 			data->is_nec_x = false;
 			data->necx_repeat = false;
 		} else if (eq_margin(ev.duration, NECX_HEADER_PULSE, NEC_UNIT / 2))
@@ -86,7 +86,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
 		if (ev.pulse)
 			break;
 
-		if (eq_margin(ev.duration, NEC_HEADER_SPACE, NEC_UNIT / 2)) {
+		if (eq_margin(ev.duration, NEC_HEADER_SPACE, NEC_UNIT)) {
 			data->state = STATE_BIT_PULSE;
 			return 0;
 		} else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) {
Signature · 1 line
1.7.11.2
#1 lore raw

Em 31-07-2012 07:37, Sean Young escreveu:

Quoted 23 lines

This remote sends a header pulse of 8150us followed by a space of 4000us.

---
 drivers/media/rc/ir-nec-decoder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/rc/ir-nec-decoder.c +1 -1
index 3c9431a..2ca509e 100644
@@ -70,7 +70,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
 		if (!ev.pulse)
 			break;
 
-		if (eq_margin(ev.duration, NEC_HEADER_PULSE, NEC_UNIT / 2)) {
+		if (eq_margin(ev.duration, NEC_HEADER_PULSE, NEC_UNIT * 2)) {
 			data->is_nec_x = false;
 			data->necx_repeat = false;
 		} else if (eq_margin(ev.duration, NECX_HEADER_PULSE, NEC_UNIT / 2))

drivers/media/rc/ir-nec-decoder.c static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) · line 92

Quoted 8 lines
drivers/media/rc/ir-nec-decoder.c +1 -1
@@ -86,7 +86,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
 		if (ev.pulse)
 			break;
 
-		if (eq_margin(ev.duration, NEC_HEADER_SPACE, NEC_UNIT / 2)) {
+		if (eq_margin(ev.duration, NEC_HEADER_SPACE, NEC_UNIT)) {
 			data->state = STATE_BIT_PULSE;
 			return 0;
 		} else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) {

The timings above are adjusted for 9000us/4500us, with a tolerance of 281,250us. You're changing the pulse tolerance to 1125us for pulse, and 562,5us for space.

I double-checked: this shouldn't interfere with the other decoders, so it could be possible to apply it, without causing regressions.

I'll apply it.

Regards,
Mauro