UP
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#define LOG_TIMER
|
||||
//#define LOG_FOR_MCU
|
||||
#define LOG_LINE_END_CRLF
|
||||
#define LOG_WITH_RUN_TIMER
|
||||
//#define LOG_WITH_RUN_TIMER
|
||||
#define LOG_OUTPUT_LVL LOG_LVL_INFO
|
||||
////////////////////////
|
||||
|
||||
|
@@ -135,6 +135,27 @@ float Str2Float(char *str);
|
||||
printf(fmt " ", arr[i]); }\
|
||||
printf("\n"); } while (0)
|
||||
|
||||
/**
|
||||
* @brief 测试函数执行时间
|
||||
* @param name: [输入] 测试名称
|
||||
* @param pFunction: [输入] 指向待测试函数的指针
|
||||
* @return void
|
||||
* @example Test("FunctionName", functionName);
|
||||
**/
|
||||
void Test_RunTime(char *name, void (*pFunction)());
|
||||
|
||||
#define END "\n"
|
||||
#define TYPE_F(v) _Generic((v), \
|
||||
char :"[char]-> "#v"=%c" END, \
|
||||
short :"[short]-> "#v"=%d" END, \
|
||||
int :"[int]-> "#v"=%d" END, \
|
||||
float :"[float]-> "#v"=%.2f" END , \
|
||||
double :"[double]-> "#v"=%.2f" END, \
|
||||
default: "[err]-> "#v"=%p" END)
|
||||
#define POUT(s) printf(TYPE_F(s) ,s)
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user