应该算是一点儿教训
在这篇博客里http://bbs.ednchina.com/BLOG_ARTICLE_3011860.HTM,使用中断,其实不难,但是却忙活一天
主要原因是使用了中断,中断的配置(NVIC的配置)是在库文件misc.c中,所以要在工程中添加库文件misc.c,另外,还要添加头文件misc.h,这在头文件stm32f10x_conf.h中
/* Includes -----------------------------------------------------------------*/
/* Uncomment the line below to enable peripheral header file inclusion */
/* #include "stm32f10x_adc.h" */
/* #include "stm32f10x_bkp.h" */
/* #include "stm32f10x_can.h" */
/* #include "stm32f10x_crc.h" */
/* #include "stm32f10x_dac.h" */
/* #include "stm32f10x_dbgmcu.h" */
/* #include "stm32f10x_dma.h" */
/* #include "stm32f10x_exti.h" */
/*#include "stm32f10x_flash.h"*/
/* #include "stm32f10x_fsmc.h" */
#include "stm32f10x_gpio.h"
/* #include "stm32f10x_i2c.h" */
/* #include "stm32f10x_iwdg.h" */
/* #include "stm32f10x_pwr.h" */
#include "stm32f10x_rcc.h"
/* #include "stm32f10x_rtc.h" */
/* #include "stm32f10x_sdio.h" */
/* #include "stm32f10x_spi.h" */
/* #include "stm32f10x_tim.h" */
#include "stm32f10x_usart.h"
/* #include "stm32f10x_wwdg.h" */
#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
其实就在这里,就因为文件没有添加,折腾一天
所以单独写这篇文章以示纪念和警示
文章评论(0条评论)
登录后参与讨论