From 2d456aceee129dd08244b4aa6c5f26feecdf972c Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Mon, 8 May 2017 13:37:07 +0800 Subject: [PATCH] patched with new AC encode format --- src/ir_decoder/include/ir_ac_control.h | 2 ++ src/ir_decoder/src/ir_ac_binary_parse.c | 19 ++++++++++--------- src/ir_decoder/src/ir_ac_control.c | 1 + 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/ir_decoder/include/ir_ac_control.h b/src/ir_decoder/include/ir_ac_control.h index f639a86..15dad8d 100644 --- a/src/ir_decoder/include/ir_ac_control.h +++ b/src/ir_decoder/include/ir_ac_control.h @@ -22,6 +22,8 @@ extern "C" #define TAG_COUNT_FOR_PROTOCOL 29 #define TAG_INVALID 0xffff +#define TAG_INVALID_2 0xfdfd + #define MAX_DELAYCODE_NUM 16 #define MAX_BITNUM 16 diff --git a/src/ir_decoder/src/ir_ac_binary_parse.c b/src/ir_decoder/src/ir_ac_binary_parse.c index 4230008..4dfe601 100644 --- a/src/ir_decoder/src/ir_ac_binary_parse.c +++ b/src/ir_decoder/src/ir_ac_binary_parse.c @@ -21,11 +21,11 @@ extern struct tag_head *tags; UINT8 tag_count = 0; const UINT16 tag_index[TAG_COUNT_FOR_PROTOCOL] = - { - 1, 2, 3, 4, 5, 6, 7, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 41, 42, 43, 44, 45, 46, 47, 48 - }; +{ + 1, 2, 3, 4, 5, 6, 7, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 41, 42, 43, 44, 45, 46, 47, 48 +}; INT8 binary_parse_offset() { @@ -50,7 +50,8 @@ INT8 binary_parse_offset() { tags[i].tag = tag_index[i]; tags[i].offset = *(phead + i); - if (tags[i].offset == TAG_INVALID) + + if (tags[i].offset == TAG_INVALID || tags[i].offset == TAG_INVALID_2) { tags[i].len = 0; } @@ -63,14 +64,14 @@ INT8 binary_parse_len() UINT16 i = 0, j = 0; for (i = 0; i < (tag_count - 1); i++) { - if (tags[i].offset == TAG_INVALID) + if (tags[i].offset == TAG_INVALID || tags[i].offset == TAG_INVALID_2) { continue; } for (j = (UINT16) (i + 1); j < tag_count; j++) { - if (tags[j].offset != TAG_INVALID) + if (tags[j].offset != TAG_INVALID && tags[j].offset != TAG_INVALID_2) { break; } @@ -85,7 +86,7 @@ INT8 binary_parse_len() return IR_DECODE_SUCCEEDED; } } - if (tags[tag_count - 1].offset != TAG_INVALID) + if (tags[tag_count - 1].offset != TAG_INVALID && tags[tag_count - 1].offset != TAG_INVALID_2) { tags[tag_count - 1].len = p_ir_buffer->len - tag_head_offset - tags[tag_count - 1].offset; } diff --git a/src/ir_decoder/src/ir_ac_control.c b/src/ir_decoder/src/ir_ac_control.c index e0edd6b..b84d882 100644 --- a/src/ir_decoder/src/ir_ac_control.c +++ b/src/ir_decoder/src/ir_ac_control.c @@ -394,6 +394,7 @@ INT8 ir_ac_lib_parse() /* in case of running with test - begin */ #if (defined BOARD_PC || defined BOARD_PC_DLL) ir_lib_free_inner_buffer(); + ir_printf("AC parse done\n"); #endif /* in case of running with test - end */