当前位置:   article > 正文

宏USE_STDPERIPH_DRIVER 和 STM32F10X_HD

use_stdperiph_driver

 在keil中需添加这两个宏

一、宏USE_STDPERIPH_DRIVER 

1.这个宏控制了是否在应用中启动外设驱动。

2.在函数Stm32f10x.h中(在keil中设置后无需在此处开启)

#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
#ifdef USE_STDPERIPH_DRIVER
  #include "stm32f10x_conf.h"
#endif
==》决定了是否用stm32f10x_conf.h,此头文件中包含了各种外设的头文件,以及用于调试的assert_param函数和assert_failed函数(assert_failed 自定义--发生错误时执行的操作&#x

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/50530?site
推荐阅读
相关标签
  

闽ICP备14008679号