completed poc
This commit is contained in:
8
stm8-example/src/irext-example.dep
Normal file
8
stm8-example/src/irext-example.dep
Normal 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
|
||||
1259
stm8-example/src/irext-example.wed
Normal file
1259
stm8-example/src/irext-example.wed
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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++)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 };
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user