From bbe41cd56d545f628102bad1411fa9100ae00300 Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Thu, 3 Mar 2022 19:50:00 +0800 Subject: [PATCH] updated CC25XX example --- .../ir_decoder/src/include/ir_ac_build_frame.h | 2 +- .../src/include/ir_ac_parse_forbidden_info.h | 2 +- .../src/include/ir_ac_parse_frame_info.h | 2 +- .../src/include/ir_ac_parse_parameter.h | 2 +- .../Source/ir_decoder/src/include/ir_decode.h | 9 +++++---- .../ir_decoder/src/include/ir_tv_control.h | 2 +- .../Source/ir_decoder/src/ir_ac_binary_parse.c | 6 +++--- .../Source/ir_decoder/src/ir_ac_build_frame.c | 2 +- .../ir_decoder/src/ir_ac_parse_frame_info.c | 2 +- .../ir_decoder/src/ir_ac_parse_parameter.c | 2 +- .../Source/ir_decoder/src/ir_decode.c | 16 ++++++++-------- .../Source/ir_decoder/src/ir_tv_control.c | 5 +++-- 12 files changed, 27 insertions(+), 25 deletions(-) diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_build_frame.h b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_build_frame.h index 1b55b11..f77274d 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_build_frame.h +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_build_frame.h @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_utils.c +Filename: ir_ac_build_frame.h Revised: Date: 2016-10-26 Revision: Revision: 1.0 diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_forbidden_info.h b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_forbidden_info.h index a134ff9..ce86c1e 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_forbidden_info.h +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_forbidden_info.h @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_parse_forbidden_info.h +Filename: ir_ac_parse_forbidden_info.h Revised: Date: 2016-10-05 Revision: Revision: 1.0 diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_frame_info.h b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_frame_info.h index 3016ea2..3ca3667 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_frame_info.h +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_frame_info.h @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_parse_frame_parameter.h +Filename: ir_ac_parse_frame_info.h Revised: Date: 2016-10-11 Revision: Revision: 1.0 diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_parameter.h b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_parameter.h index c991e46..78680e8 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_parameter.h +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_ac_parse_parameter.h @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_parse_ac_parameter.h +Filename: ir_ac_parse_parameter.h Revised: Date: 2016-10-12 Revision: Revision: 1.0 diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_decode.h b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_decode.h index 5d8c598..54aa5c3 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_decode.h +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_decode.h @@ -221,10 +221,11 @@ typedef enum typedef enum { - SUB_CATEGORY_QUATERNARY = 0, - SUB_CATEGORY_HEXADECIMAL = 1, - SUB_CATEGORY_NEXT = 2, - SUB_CATEGORY_MAX = 7, + SUB_CATEGORY_BINARY = 0, // deprecated + SUB_CATEGORY_QUATERNARY = 1, + SUB_CATEGORY_HEXADECIMAL = 2, + SUB_CATEGORY_NEXT = 3, + SUB_CATEGORY_MAX = 4, } t_remote_sub_category; /** diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_tv_control.h b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_tv_control.h index d42d990..6ccfe6b 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_tv_control.h +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/include/ir_tv_control.h @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_lib.h +Filename: ir_tv_control.h Revised: Date: 2016-02-23 Revision: Revision: 1.0 diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_binary_parse.c b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_binary_parse.c index c2ff2eb..de1f016 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_binary_parse.c +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_binary_parse.c @@ -33,11 +33,11 @@ const UINT16 tag_index[TAG_COUNT_FOR_PROTOCOL] = INT8 binary_parse_offset() { int i = 0; -#if defined BOARD_ESP8266 +#if defined(ESP8266) || defined(ESP32) UINT8 *phead = (UINT8 *)&p_ir_buffer->data[1]; #else UINT16 *phead = (UINT16 *)&p_ir_buffer->data[1]; -#endif // BOARD_ESP8266 +#endif // ESPRESSIF tag_count = p_ir_buffer->data[0]; if (TAG_COUNT_FOR_PROTOCOL != tag_count) @@ -63,7 +63,7 @@ INT8 binary_parse_offset() #if defined BOARD_STM8 && defined COMPILER_IAR UINT16 offset = *(phead + i); tags[i].offset = (offset >> 8) | (offset << 8); -#elif defined BOARD_ESP8266 +#elif defined(ESP8266) || defined(ESP32) UINT16 tmp_a = *(phead + i * 2); UINT16 tmp_b = *(phead + i * 2 + 1); tags[i].offset = tmp_b << 8 | tmp_a; diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_build_frame.c b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_build_frame.c index b8452a7..6bba2ba 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_build_frame.c +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_build_frame.c @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_irframe.c +Filename: ir_ac_build_frame.c Revised: Date: 2016-10-01 Revision: Revision: 1.0 diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_parse_frame_info.c b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_parse_frame_info.c index 336530d..d103815 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_parse_frame_info.c +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_parse_frame_info.c @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_parse_frame_parameter.c +Filename: ir_ac_parse_frame_info.c Revised: Date: 2016-10-11 Revision: Revision: 1.0 diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_parse_parameter.c b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_parse_parameter.c index ee4e4e9..d8d2a03 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_parse_parameter.c +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_ac_parse_parameter.c @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_parse_ac_parameter.c +Filename: ir_ac_parse_parameter.c Revised: Date: 2016-10-12 Revision: Revision: 1.0 diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_decode.c b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_decode.c index 110bc22..86e9359 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_decode.c +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_decode.c @@ -139,13 +139,13 @@ INT8 ir_file_open(const UINT8 category, const UINT8 sub_category, const char* fi else { ir_binary_type = IR_TYPE_COMMANDS; - if (1 == sub_category) + if (SUB_CATEGORY_QUATERNARY == sub_category) { - ir_hexadecimal = SUB_CATEGORY_QUATERNARY; + ir_hexadecimal = 0; } - else if (2 == sub_category) + else if (SUB_CATEGORY_HEXADECIMAL == sub_category) { - ir_hexadecimal = SUB_CATEGORY_HEXADECIMAL; + ir_hexadecimal = 1; } else { @@ -205,13 +205,13 @@ INT8 ir_binary_open(const UINT8 category, const UINT8 sub_category, UINT8* binar else { ir_binary_type = IR_TYPE_COMMANDS; - if (1 == sub_category) + if (SUB_CATEGORY_QUATERNARY == sub_category) { - ir_hexadecimal = SUB_CATEGORY_QUATERNARY; + ir_hexadecimal = 0; } - else if (2 == sub_category) + else if (SUB_CATEGORY_HEXADECIMAL == sub_category) { - ir_hexadecimal = SUB_CATEGORY_HEXADECIMAL; + ir_hexadecimal = 1; } else { diff --git a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_tv_control.c b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_tv_control.c index fe13cb0..88796f5 100644 --- a/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_tv_control.c +++ b/cc25xx-8051-example/ti/BLE-CC254x/Projects/ble/SimpleBLEPeripheral-IREXT/Source/ir_decoder/src/ir_tv_control.c @@ -1,5 +1,5 @@ /************************************************************************************** -Filename: ir_lib.c +Filename: ir_tv_control.c Revised: Date: 2016-10-21 Revision: Revision: 1.0 @@ -120,7 +120,8 @@ static BOOL get_ir_protocol(UINT8 encode_type) if (encode_type == 0) { - cycles_num_size = 8; /* "BOOT", "STOP", "SEP", "ONE", "ZERO", "FLIP", "TWO", "THREE" */ + cycles_num_size = 8; + /* "BOOT", "STOP", "SEP", "ONE", "ZERO", "FLIP", "TWO", "THREE" */ if (prot_cycles_num[IRDA_TWO] == 0 && prot_cycles_num[IRDA_THREE] == 0) { ir_decode_flag = IRDA_DECODE_1_BIT;