// SPDX-License-Identifier: GPL-2.0+ // ir-rcmm-decoder.c - A decoder for the RCMM IR protocol // // Copyright (C) 2018 by Patrick Lerda <patrick9876@free.fr>
case 12: if (dev->enabled_protocols & RC_PROTO_BIT_RCMM12) {
rc_keydown(dev, RC_PROTO_RCMM12, data->bits, 0);
data->state = STATE_INACTIVE; return 0;
} return -1;
}
return -1;
}
/** * ir_rcmm_decode() - Decode one RCMM pulse or space * @dev: the struct rc_dev descriptor of the device * @ev: the struct ir_raw_event descriptor of the pulse/space * * This function returns -EINVAL if the pulse violates the state machine
*/ staticint ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev)
{ struct rcmm_dec *data = &dev->raw->rcmm;
u32 scancode;
u8 toggle; int value;
if (!(dev->enabled_protocols & (RC_PROTO_BIT_RCMM32 |
RC_PROTO_BIT_RCMM24 |
RC_PROTO_BIT_RCMM12))) return 0;
if (!is_timing_event(ev)) { if (ev.overflow)
data->state = STATE_INACTIVE; return 0;
}
switch (data->state) { case STATE_INACTIVE: if (!ev.pulse) break;
if (!eq_margin(ev.duration, RCMM_PREFIX_PULSE, RCMM_UNIT)) break;
switch (protocol) { case RC_PROTO_RCMM32:
ret = ir_rcmm_rawencoder(&e, max, 32, scancode); break; case RC_PROTO_RCMM24:
ret = ir_rcmm_rawencoder(&e, max, 24, scancode); break; case RC_PROTO_RCMM12:
ret = ir_rcmm_rawencoder(&e, max, 12, scancode); break; default:
ret = -EINVAL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.