[FL-1696, FL-1685] IRDA: Add RC5, decoder refactoring (#663)
* [FL-1696] IRDA: Split decoders and protocols * IRDA: Restruct directories. * IRDA: fix long timings * [FL-1685] IRDA: Add RC5 Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "irda.h"
|
||||
#include "irda_protocol_defs_i.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -17,6 +18,7 @@ bool irda_decoder_samsung32_interpret(IrdaCommonDecoder* decoder) {
|
||||
if ((address1 == address2) && (command == (uint8_t) ~command_inverse)) {
|
||||
decoder->message.command = command;
|
||||
decoder->message.address = address1;
|
||||
decoder->message.protocol = IrdaProtocolSamsung32;
|
||||
decoder->message.repeat = false;
|
||||
result = true;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "furi/check.h"
|
||||
#include "irda_common_i.h"
|
||||
#include "common/irda_common_i.h"
|
||||
#include <stdint.h>
|
||||
#include "../irda_i.h"
|
||||
#include "irda_protocol_defs_i.h"
|
||||
|
18
lib/irda/encoder_decoder/samsung/irda_samsung_spec.c
Normal file
18
lib/irda/encoder_decoder/samsung/irda_samsung_spec.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "../irda_i.h"
|
||||
#include "irda_protocol_defs_i.h"
|
||||
|
||||
static const IrdaProtocolSpecification irda_samsung32_protocol_specification = {
|
||||
.name = "Samsung32",
|
||||
.address_length = 2,
|
||||
.command_length = 2,
|
||||
.frequency = IRDA_COMMON_CARRIER_FREQUENCY,
|
||||
.duty_cycle = IRDA_COMMON_DUTY_CYCLE,
|
||||
};
|
||||
|
||||
const IrdaProtocolSpecification* irda_samsung32_get_spec(IrdaProtocol protocol) {
|
||||
if (protocol == IrdaProtocolSamsung32)
|
||||
return &irda_samsung32_protocol_specification;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user