在线时间0 小时
UID253089
ST金币0
蝴蝶豆0
注册时间2010-12-9
新手上路
- 最后登录
- 1970-1-1
|
a0a.1 0b0c
我就想实现最简单的外部中断,当按钮按下时产生中断控制LED灯,但是老是出现这个问题..\User\src\main.c(119): error: #20: identifier "EXTI3_IRQChannel" is undefined,老是说EXTI3_IRQChannel没有定义,怎么回事,弄了好久都没弄好,哎,急救啊
附件里有我的main文件,帮忙看看,谢谢啊~~~~~~~~~~~
附NVIC的配置:
void NVIC_Config(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_StructInit(&NVIC_InitStructure);
NVIC_PriorityGroupConfig (NVIC_PriorityGroup_0 ); //设置中断嵌套控制的优先级
//针对中断线2
NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQChannel; //NVIC外设的初始化
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority =0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority=0;
NVIC_InitStructure.NVIC_IRQChannelCmd =ENABLE;
NVIC_Init(&NVIC_InitStructure);
//针对中断线3
NVIC_InitStructure.NVIC_IRQChannel = EXTI3_IRQChannel ; //NVIC外设的初始化
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority =1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority=1;
NVIC_InitStructure.NVIC_IRQChannelCmd =ENABLE;
NVIC_Init(&NVIC_InitStructure);
} |
-
-
5.8 KB, 下载次数: 16, 下载积分: ST金币 -1
|