当前位置:网站首页>Macro definition and multiple parameters

Macro definition and multiple parameters

2022-07-08 01:13:00 __ Small crisp__

Macro definition and multiple parameters

because keil Configured library function package , The following error occurred during compilation :

.\Objects\new.axf: Error: L6218E: Undefined symbol assert_param (referred from stm32f4xx_gpio.o)

as a result of keil Fewer macros in the configuration

stay stm32f4xx.h in , You can see
 Insert picture description here
 Insert picture description here
It can be seen that there is no configuration USE_STDPERIPH_DRIVER Can't contain stm32f4xx_conf.h
See a usage

#if defined A|| defined B /* A or  B Defined , Then select execute printf1, Otherwise execution printf2 */
	printf1(".....");
#else
	printf2(".....");
#endif


#if !defined A|| !defined B /* A or  B Undefined , Then select execute printf1, Otherwise execution printf2 */
	printf1(".....");
#else
	printf2(".....");
#endif

#if defined and #if !defined Can define parameters with multiple macros
#ifdef and #ifndef Parameters can only be defined with a macro , You can't use expressions

原网站

版权声明
本文为[__ Small crisp__]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130546543578.html