fixed windows dll importing issue for decoder

This commit is contained in:
strawmanbobi
2016-12-17 21:38:33 +08:00
parent 020ba989db
commit 2eb2091ff5
7 changed files with 15 additions and 21 deletions

View File

@@ -44,5 +44,5 @@ set(SOURCE_FILES_SHARED_LIB
irda_utils.c
include/irda_utils.h)
# add_executable(irda_decoder ${SOURCE_FILES_EXECUTABLE})
add_library(irda_decoder SHARED ${SOURCE_FILES_SHARED_LIB})
add_executable(irda_decoder ${SOURCE_FILES_EXECUTABLE})
# add_library(irda_decoder SHARED ${SOURCE_FILES_SHARED_LIB})

View File

@@ -434,6 +434,7 @@ extern protocol* context;
extern remote_ac_status_t ac_status;
extern UINT16 user_data[];
/* exported functions */
///////////////////////////////////////////////// AC Begin /////////////////////////////////////////////////
/*
@@ -515,7 +516,7 @@ extern INT8 irda_tv_lib_parse(UINT8 irda_hex_encode);
*
* return: length of wave code array
*/
extern UINT16 irda_tv_lib_control(UINT8 key_code, UINT16 * l_user_data);
extern UINT16 irda_tv_lib_control(UINT8 key_code, UINT16* user_data);
/*
* function irda_tv_lib_close
@@ -575,7 +576,7 @@ extern INT8 get_supported_swing(UINT8 ac_mode, UINT8* supported_swing);
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
INT8 get_supported_wind_direction(UINT8* supported_wind_direction);
extern INT8 get_supported_wind_direction(UINT8* supported_wind_direction);
///////////////////////////////////////////////// Utils End /////////////////////////////////////////////////

View File

@@ -15,6 +15,4 @@ get_temperature_range @10
get_supported_mode @11
get_supported_wind_speed @12
get_supported_swing @13
get_supported_wind_direction @14
irda_ac_file_open @15
irda_tv_file_open @16
get_supported_wind_direction @14

View File

@@ -153,7 +153,6 @@
<ClInclude Include="include\irda_ac_parse_parameter.h" />
<ClInclude Include="include\irda_decode.h" />
<ClInclude Include="include\irda_defs.h" />
<ClInclude Include="include\irda_main.h" />
<ClInclude Include="include\irda_tv_parse_protocol.h" />
<ClInclude Include="include\irda_utils.h" />
<ClInclude Include="stdafx.h" />
@@ -180,7 +179,6 @@
<ClCompile Include="irda_ac_parse_frame_parameter.c" />
<ClCompile Include="irda_ac_parse_parameter.c" />
<ClCompile Include="irda_decode.c" />
<ClCompile Include="irda_main.c" />
<ClCompile Include="irda_tv_parse_protocol.c" />
<ClCompile Include="irda_utils.c" />
<ClCompile Include="stdafx.c">

View File

@@ -42,10 +42,9 @@ UINT16 tv_bin_length = 0;
UINT8 tag_count = 0;
UINT16 tag_head_offset = 0;
UINT8 byteArray[PROTOCOL_SIZE] = {0};
UINT16 user_data[USER_DATA_SIZE] = {0};
UINT8 tv_bin[EXPECTED_MEM_SIZE] = {0};
remote_ac_status_t ac_status;
UINT8 byteArray[PROTOCOL_SIZE] = { 0 };
UINT8 tv_bin[EXPECTED_MEM_SIZE] = { 0 };
// 2016-10-09 updated by strawmanbobi, change global data context to array pointer
protocol *context = (protocol *) byteArray;
@@ -1029,10 +1028,6 @@ void irda_ac_lib_close()
}
free_ac_context();
if (NULL != binary_content)
{
free(binary_content);
}
return;
}
@@ -1203,7 +1198,7 @@ UINT16 irda_tv_lib_control(UINT8 key, UINT16* l_user_data)
{
UINT16 print_index = 0;
UINT16 irda_code_length = 0;
memset(user_data, 0x00, USER_DATA_SIZE);
memset(l_user_data, 0x00, USER_DATA_SIZE);
irda_code_length = tv_lib_control(key, l_user_data);
// have some debug
@@ -1211,7 +1206,7 @@ UINT16 irda_tv_lib_control(UINT8 key, UINT16* l_user_data)
IR_PRINTF("length of IRDA code = %d\n", irda_code_length);
for(print_index = 0; print_index < irda_code_length; print_index++)
{
IR_PRINTF("%d ", user_data[print_index]);
IR_PRINTF("%d ", l_user_data[print_index]);
}
IR_PRINTF("\n=============================\n\n");

View File

@@ -29,6 +29,8 @@ Revision log:
// global variable definition
long binary_length = 0;
UINT8 *binary_content = NULL;
remote_ac_status_t ac_status;
UINT16 user_data[USER_DATA_SIZE];
INT8 irda_ac_file_open(const char* file_name);
INT8 irda_tv_file_open(const char* file_name);

View File

@@ -42,14 +42,14 @@ Revision log:
/**************************************************************************************************
* LOCAL DATA TYPES
**************************************************************************************************/
#pragma pack(1)
struct buffer
{
UINT8 *data;
UINT16 len;
UINT16 offset;
} irda_file;
#pragma pack()