新手上路
- 积分
- 48
- 金钱
- 48
- 注册时间
- 2014-11-27
- 在线时间
- 2 小时
|

楼主 |
发表于 2014-11-27 17:08:52
|
显示全部楼层
原来在这。明白了。
那是不是也可以在实际头文件中直接宏定义呢?
在stm32f4xx.h中第68行:
#if !defined (STM32F40_41xxx) && !defined (STM32F427_437xx) && !defined (STM32F429_439xx) && !defined (STM32F401xx) && !defined (STM32F411xE)
/* #define STM32F40_41xxx */ /*!< STM32F405RG, STM32F405VG, STM32F405ZG, STM32F415RG, STM32F415VG, STM32F415ZG,
如果不将下面那行注释掉“#define STM32F40_41xxx”,那么是不是可以达到同样的目的?也就不用在编译器上填写“STM32F40_41xxx”?
USE_STDPERIPH_DRIVER同理。
#if !defined (USE_STDPERIPH_DRIVER)
/**
* @brief Comment the line below if you will not use the peripherals drivers.
In this case, these drivers will not be included and the application code will
be based on direct access to peripherals registers
*/
/*#define USE_STDPERIPH_DRIVER */
#endif /* USE_STDPERIPH_DRIVER */
在编译器里定义和在头文件里定义有什么区别?
|
|