Hi Jardon,

I am writing IR receiver driver over GPIO line.
Trying to read the frame sent by Samsung remote.
I am sending interrupt events to rc frame work using ir_raw_event_store_edge()

I am able to see that above API is pushing previous pulse/space packet to rc framework when an interrupt is reported to it.
I am facing one issue with NEC decoder.

NECx protocol format has one start bit, 32 data bits and one stop bit

stop bit: pulse (562us) & space ( untill next key press event)

so i think here we should skip the STATE_TRAILER_SPACE event because the width of it is not fixed for some of NECx protocols like samsung remote.


        case STATE_TRAILER_PULSE:
                if (!ev.pulse)
                        break;

                if (!eq_margin(ev.duration, NEC_TRAILER_PULSE, NEC_UNIT
                        break;

                data->state = STATE_TRAILER_SPACE;
                IR_dprintk(1, "NEC (Ext) state set %d\n", data->state);
                return 0;

        case STATE_TRAILER_SPACE:
                if (ev.pulse)
                        break;

if (!geq_margin(ev.duration, NEC_TRAILER_SPACE, NEC_UNIT / 2))
                        break;

                address     = bitrev8((data->bits >> 24) & 0xff);
                not_address = bitrev8((data->bits >> 16) & 0xff);
                command     = bitrev8((data->bits >>  8) & 0xff);
                not_command = bitrev8((data->bits >>  0) & 0xff);

                if ((command ^ not_command) != 0xff) {
IR_dprintk(1, "NEC checksum error: received 0x%08x\n",
                                   data->bits);
                        send_32bits = true;
                }


--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to