调整代码
This commit is contained in:
parent
6c7252b51d
commit
85e0e11829
|
@ -969,6 +969,10 @@ namespace setting3399
|
|||
G400_AUTO = 16,
|
||||
G400_MAXAUTO = 16
|
||||
};
|
||||
|
||||
|
||||
//#define SAVE_TO_FILE
|
||||
|
||||
}
|
||||
//3399协议整理 -OVER
|
||||
#pragma pack(pop)
|
||||
|
|
|
@ -38,14 +38,25 @@ if (NULL != (p)) {delete((p)); \
|
|||
(p) = NULL; \
|
||||
}\
|
||||
}
|
||||
#ifdef OEM_HANWANG
|
||||
#define hg_scanner hw_scanner
|
||||
#elif defined(OEM_LISICHENG)
|
||||
#define hg_scanner lsc_scanner
|
||||
#elif defined(OEM_CANGTIAN)
|
||||
#define hg_scanner cts_scanner
|
||||
#endif
|
||||
//#ifdef OEM_HANWANG
|
||||
//#define hg_scanner hw_scanner
|
||||
//#elif defined(OEM_LISICHENG)
|
||||
//#define hg_scanner lsc_scanner
|
||||
//#elif defined(OEM_CANGTIAN)
|
||||
//#define hg_scanner cts_scanner
|
||||
//#endif
|
||||
|
||||
|
||||
#define USB_REQ_GET_FPGA_REGS 0x40
|
||||
#define USB_REQ_SET_FPGA_REGS 0x41
|
||||
#define USB_REQ_GET_MOTOR_REGS 0x42
|
||||
#define USB_REQ_SET_MOTOR_REGS 0x43
|
||||
|
||||
#define USB_REQ_GET_DEV_STATUS 0x60
|
||||
#define USB_REQ_GET_DEV_CONFIGURATION 0x61
|
||||
#define USB_REQ_SET_DEV_CONFIGURATION 0x62
|
||||
#define USB_REQ_GET_DEV_REGS 0x63
|
||||
#define USB_REQ_SET_DEV_REGS 0x64
|
||||
class hg_scanner
|
||||
{
|
||||
bool notify_setting_result_;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -486,7 +486,11 @@ extern "C"{
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define SAFE_FREE(p){ \
|
||||
if (NULL != (p)) {free((p)); \
|
||||
(p) = NULL; \
|
||||
}\
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// log ...
|
||||
|
@ -500,9 +504,10 @@ extern "C"{
|
|||
if(hg_scanner_log_is_enable(level)) \
|
||||
{ \
|
||||
char* msgbuf = (char*)malloc(bytes); \
|
||||
sprintf(msgbuf, fmt, arg1); \
|
||||
if (msgbuf != NULL) \
|
||||
sprintf(msgbuf, fmt, arg1); \
|
||||
hg_scanner_log(msgbuf); \
|
||||
free(msgbuf); \
|
||||
SAFE_FREE(msgbuf); \
|
||||
}
|
||||
#define VLOG_MINI_1(level, fmt, arg1) VLOG_1(level, VLOG_MINI_BYTES, fmt, arg1)
|
||||
|
||||
|
@ -510,9 +515,10 @@ extern "C"{
|
|||
if(hg_scanner_log_is_enable(level)) \
|
||||
{ \
|
||||
char* msgbuf = (char*)malloc(bytes); \
|
||||
sprintf(msgbuf, fmt, arg1, arg2); \
|
||||
if (msgbuf != NULL) \
|
||||
sprintf(msgbuf, fmt, arg1, arg2); \
|
||||
hg_scanner_log(msgbuf); \
|
||||
free(msgbuf); \
|
||||
SAFE_FREE(msgbuf); \
|
||||
}
|
||||
#define VLOG_MINI_2(level, fmt, arg1, arg2) VLOG_2(level, VLOG_MINI_BYTES, fmt, arg1, arg2)
|
||||
|
||||
|
@ -520,9 +526,10 @@ extern "C"{
|
|||
if(hg_scanner_log_is_enable(level)) \
|
||||
{ \
|
||||
char* msgbuf = (char*)malloc(bytes); \
|
||||
sprintf(msgbuf, fmt, arg1, arg2, arg3); \
|
||||
if (msgbuf != NULL) \
|
||||
sprintf(msgbuf, fmt, arg1, arg2, arg3); \
|
||||
hg_scanner_log(msgbuf); \
|
||||
free(msgbuf); \
|
||||
SAFE_FREE(msgbuf); \
|
||||
}
|
||||
#define VLOG_MINI_3(level, fmt, arg1, arg2, arg3) VLOG_3(level, VLOG_MINI_BYTES, fmt, arg1, arg2, arg3)
|
||||
|
||||
|
@ -530,9 +537,10 @@ extern "C"{
|
|||
if(hg_scanner_log_is_enable(level)) \
|
||||
{ \
|
||||
char* msgbuf = (char*)malloc(bytes); \
|
||||
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4); \
|
||||
if (msgbuf != NULL) \
|
||||
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4); \
|
||||
hg_scanner_log(msgbuf); \
|
||||
free(msgbuf); \
|
||||
SAFE_FREE(msgbuf); \
|
||||
}
|
||||
#define VLOG_MINI_4(level, fmt, arg1, arg2, arg3, arg4) \
|
||||
VLOG_4(level, VLOG_MINI_BYTES, fmt, arg1, arg2, arg3, arg4)
|
||||
|
@ -541,9 +549,10 @@ extern "C"{
|
|||
if(hg_scanner_log_is_enable(level)) \
|
||||
{ \
|
||||
char* msgbuf = (char*)malloc(bytes); \
|
||||
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4, arg5); \
|
||||
if(msgbuf) \
|
||||
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4, arg5); \
|
||||
hg_scanner_log(msgbuf); \
|
||||
free(msgbuf); \
|
||||
SAFE_FREE(msgbuf); \
|
||||
}
|
||||
#define VLOG_MINI_5(level, fmt, arg1, arg2, arg3, arg4, arg5) \
|
||||
VLOG_5(level, VLOG_MINI_BYTES, fmt, arg1, arg2, arg3, arg4, arg5)
|
||||
|
@ -552,10 +561,12 @@ extern "C"{
|
|||
if(hg_scanner_log_is_enable(level)) \
|
||||
{ \
|
||||
char* msgbuf = (char*)malloc(bytes); \
|
||||
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4, arg5, arg6); \
|
||||
hg_scanner_log(msgbuf); \
|
||||
free(msgbuf); \
|
||||
if (msgbuf != NULL) \
|
||||
sprintf(msgbuf, fmt, arg1, arg2, arg3, arg4, arg5, arg6); \
|
||||
hg_scanner_log(msgbuf); \
|
||||
SAFE_FREE(msgbuf); \
|
||||
}
|
||||
|
||||
#define VLOG_MINI_6(level, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
|
||||
VLOG_6(level, VLOG_MINI_BYTES, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
|
||||
|
|
Loading…
Reference in New Issue