completed poc

This commit is contained in:
strawmanbobi
2018-02-05 07:50:28 +08:00
parent 1bdd4560a3
commit 432f2476bc
15 changed files with 1801 additions and 476 deletions

View File

@@ -0,0 +1,8 @@
; STMicroelectronics dependencies file
[Version]
Keyword=ST7Project
Number=1.3
[Root.Source Files.irext\src\ir_ac_apply.c.Config.0]
ExternDep=irext\src\ir_ac_apply.c

File diff suppressed because it is too large Load Diff

View File

@@ -9,15 +9,18 @@ Revision log:
* 2017-01-03: created by strawmanbobi
**************************************************************************************/
#include <stdlib.h>
#include "../include/ir_ac_binary_parse.h"
#include "../include/ir_decode.h"
UINT16 tag_head_offset = 0;
extern struct ir_bin_buffer *p_ir_buffer;
extern struct tag_head *tags;
#if defined USE_DYNAMIC_TAG
extern struct tag_head* tags;
#else
extern struct tag_head tags[];
#endif
UINT8 tag_count = 0;
const UINT16 tag_index[TAG_COUNT_FOR_PROTOCOL] =
@@ -40,11 +43,14 @@ INT8 binary_parse_offset()
tag_head_offset = (UINT16) ((tag_count << 1) + 1);
#if defined USE_DYNAMIC_TAG
tags = (t_tag_head *) ir_malloc(tag_count * sizeof(t_tag_head));
if (NULL == tags)
{
return IR_DECODE_FAILED;
}
#endif
for (i = 0; i < tag_count; i++)
{

View File

@@ -22,7 +22,12 @@ Revision log:
#include "../include/ir_utils.h"
#if defined USE_DYNAMIC_TAG
extern struct tag_head *tags;
#else
extern struct tag_head tags[];
#endif
extern UINT8 tag_count;
static INT8 ir_context_init();
@@ -87,8 +92,8 @@ INT8 ir_ac_lib_parse()
context->si.type = SWING_TYPE_NORMAL;
context->si.mode_count = 2;
}
break;
context->si.dir_index = 0;
break;
}
}
@@ -360,11 +365,13 @@ INT8 ir_ac_lib_parse()
}
}
#if defined USE_DYNAMIC_TAG
if (NULL != tags)
{
ir_free(tags);
tags = NULL;
}
#endif
ir_hex_code = (UINT8 *) ir_malloc(context->default_code.len);
if (NULL == ir_hex_code)

View File

@@ -21,8 +21,12 @@ Revision log:
struct ir_bin_buffer binary_file;
struct ir_bin_buffer *p_ir_buffer = &binary_file;
struct tag_head *tags;
#if defined USE_DYNAMIC_TAG
struct tag_head *tags;
#else
struct tag_head tags[TAG_COUNT_FOR_PROTOCOL];
#endif
UINT8 *ir_hex_code = NULL;
UINT8 ir_hex_len = 0;
@@ -375,12 +379,15 @@ static UINT16 ir_ac_lib_control(t_remote_ac_status ac_status, UINT16 *user_data,
static INT8 ir_ac_lib_close()
{
#if defined USE_DYNAMIC_TAG
// free context
if (NULL != tags)
{
ir_free(tags);
tags = NULL;
}
#endif
free_ac_context();
return IR_DECODE_SUCCEEDED;

View File

@@ -23,7 +23,6 @@ define region FarFuncCode = [from 0x8000 to 0xFFFF]
define region HugeFuncCode = [from 0x8000 to 0x17FFF];
/////////////////////////////////////////////////////////////////
define block CSTACK with size = _CSTACK_SIZE {};
@@ -87,11 +86,11 @@ place in NearFuncCode { ro section __DLIB_PERTHREAD_init,
ro section .huge.data_init,
ro section .huge_func.textrw_init,
ro section .iar.init_table,
ro section .init_array,
ro section .init_array,
ro section .near.data_init,
ro section .near.rodata,
ro section .near_func.text,
ro section .near_func.textrw_init,
ro section .near_func.text,
ro section .near_func.textrw_init,
ro section .tiny.data_init,
ro section .tiny.rodata_init };
@@ -101,10 +100,10 @@ place in FarFuncCode { ro section .far.rodata,
place in HugeFuncCode { ro section .huge.rodata,
ro section .huge_func.text };
place in Eeprom { section .eeprom.noinit };
place in Eeprom { section .eeprom.noinit };
place in Eeprom { section .eeprom.data };
place in Eeprom { section .eeprom.data };
place in Eeprom { section .eeprom.rodata };
place in Eeprom { section .eeprom.rodata };
/////////////////////////////////////////////////////////////////

View File

@@ -104,7 +104,7 @@ static void stop_uart_receive();
/* test mode */
#if defined TEST_MODE
#define TEST_BIN_SIZE 568
const uint8_t ac_code[568] =
const uint8_t ac_code[TEST_BIN_SIZE] =
{
0x1D, 0x00, 0x00, 0x09, 0x00, 0x10, 0x00, 0x18, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x34,
0x00, 0x58, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,