Quantcast
Channel: MSP 低功耗微控制器论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 3634

串口打印宏定义报错

$
0
0

芯片:MSP430FR6972

IDE:IAR6.30.1

问题描述:

我想使用宏定义的方式使用printf,但是按照下面这种方式一直报警告(

Warning[Pe1665]: concatenation with "down" in macro "DEBUG" does not create a valid token F:\WorkSpace\PW_KSH_C1_V1.0\Src\data_deal.c 550

)

所以想请教一下如何定义才算正确?

#if USE_DEBUG==1

#define DEBUG(format, ...) printf(format,##__VA_ARGS__)
#else
#define DEBUG(format, ...)
#endif


Viewing all articles
Browse latest Browse all 3634

Trending Articles