updated CC25XX example

This commit is contained in:
strawmanbobi
2022-03-03 19:50:00 +08:00
parent 7ae970c31f
commit bbe41cd56d
12 changed files with 27 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
/**************************************************************************************
Filename: ir_utils.c
Filename: ir_ac_build_frame.h
Revised: Date: 2016-10-26
Revision: Revision: 1.0

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;
/**

View File

@@ -1,5 +1,5 @@
/**************************************************************************************
Filename: ir_lib.h
Filename: ir_tv_control.h
Revised: Date: 2016-02-23
Revision: Revision: 1.0

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
/**************************************************************************************
Filename: ir_irframe.c
Filename: ir_ac_build_frame.c
Revised: Date: 2016-10-01
Revision: Revision: 1.0

View File

@@ -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

View File

@@ -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

View File

@@ -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
{

View File

@@ -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;