避免重复使用if语句,或直接执行return语句,避免使用goto语句
//Title: Tackle the multple workflow together by once at the end
//Author: Aletenze
//Time: 2011-12-10
//Version: 1.0.0.2
/* 接口通用返回码
-1 - 参数错误
-2 - 串口未打开
-3 - 写串口数据失败
-4 - 读串口数据失败
-5 - 包检验出错
-6 - 包错
-7 - 固件错误
-999 - 未知错误(异常)
*/
#define SUCCESS_RETURN_VALUE (0) //函数成功执行返回值
#define TL_SUCCESS (0)
#define PARAM_ERR (-1)
#define PORT_DISOPEN_ERR (-2)
#define WRITEDATA_ERR (-3)
#define READDATA_ERR (-4)
#define PKG_CHECK_ERR (-5)
#define PKG_DATA_ERR (-6)
#define FIRMWARE_ERR (-7)
#define UNKNOWN_ERR (-999)
#define MAX_PROCESS_COUNT (1<<31) //最大的整数, max(int)
#define BREAK_WHILE_VALUE MAX_PROCESS_COUNT //最大的process数目
int process1(); //工作1
int process2();// 工作2
int process3(); //工作3
int LogInfo(LPCTSTR format,...); // 记录日志函数
int getRe