[STM32F1] 基础例程添加中断功能, 编译不能通

[复制链接]
1845|2
 楼主| scic773 发表于 2014-5-2 10:49 | 显示全部楼层 |阅读模式
基础例程 tim ch2 中添加中断功能, 编译不能通过,

在Tim3 ch2 例程main 头文件中添加  #include "stm32f10x_exti.h"
在 void NVIC_Configuration(void) 函数中添加
{   EXTI_InitTypeDef EXTI_InitStructure;
    //用于配置AFIO外部中断配置寄存器AFIO_EXTICR1,用于选择EXTI15外部中断的输入源是PB15。
  GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource15);     //外部中断配置AFIO--ETXI15-10
EXTI_InitStructure.EXTI_Line = EXTI_Line15;                       //PC5 作为键盘K1 检测状态
  EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;               //中断模式
  EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;           //下降沿触发
  EXTI_InitStructure.EXTI_LineCmd = ENABLE;
  EXTI_Init(&EXTI_InitStructure);   

在 void time_ini(void)函数中,添加
  {  /* K1 配置按键中断线PB15 */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;                     //输入上拉
  GPIO_Init(GPIOB, &GPIO_InitStructure);

编译不能通过,显示 :
..\ObjFlash\STM32-FD-TIM3-CH2.axf: Error: L6218E: Undefined symbol EXTI_Init (referred from main.o).
..\ObjFlash\STM32-FD-TIM3-CH2.axf: Not enough information to list image symbols.
..\ObjFlash\STM32-FD-TIM3-CH2.axf: Finished: 1 information, 0 warning and 1 error messages.
Target not created
mmuuss586 发表于 2014-5-2 13:42 | 显示全部楼层
exti.C程序未添加吧。
tianli1980 发表于 2014-5-6 20:39 | 显示全部楼层
感觉楼主是不是路径设置有错误呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

6

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部