下面代码,…是传入的参数,__VA_ARGS__是被传入的地方
#if 1
#define printk(...) rt_kprintf(__VA_ARGS__);
#else
#define printk(...)
#endif
通过这种方法,可以方便的关闭log,另外rtthread有自己的debug函数,通过config中打开就能用,但好像要调点东西,目前没有用到过。
下面代码,…是传入的参数,__VA_ARGS__是被传入的地方
#if 1
#define printk(...) rt_kprintf(__VA_ARGS__);
#else
#define printk(...)
#endif
通过这种方法,可以方便的关闭log,另外rtthread有自己的debug函数,通过config中打开就能用,但好像要调点东西,目前没有用到过。
一种打log的方法——使用define打开关闭log
http://guapi.eu.org:8090/archives/一种打log的方法使用define打开关闭log