GPIO的main.c测试程序内有这样一段代码:
EXTI_InitStructure.EXTI_Line = EXTI_Line9;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
设置中断寄存器,而EXTI_Init()的函数中有如下代码:
if (EXTI_InitStruct->!= DISABLE
{
/* Clear EXTI line configuration */
EXTI->IMR &= ~EXTI_InitStruct->EXTI_Line;
EXTI->EMR &= ~EXTI_InitStruct->EXTI_Line;
.................................................
在定义文件中,
#define EXTI_Line9 ((u32)0x00200) /* External interrupt line 9 */
因此:EXTI->IMR &=~EXTI_InitStruct->EXTI_Line; 也就是:
EXTI->IMR &=~((u32)0x00200);
IMR 的MR9应该是0,而在实际仿真中,MR9=1
请教高手,其中原因
|