外部中断初始化采用库函数,在程序中想屏蔽这个线的外部中断,于是就用了寄存器EXTI->IMR &= ~ EXTI_LineX(X=0)屏蔽改线,打开EXTI->IMR |= EXTI_LineX(X=0)测试结果发现不行,在库函数初始化中将 EXTI_InitStructure.EXTI_LineCmd = DISABLE;此句屏蔽,发现可以。于是进去EXTI_Init(); 该函数, //tmp = (uint32_t)EXTI_BASE;
else //DISABLE {
tmp += EXTI_InitStruct->EXTI_Mode;//EXTI_InitStruct->EXTI_Mode =0
/* Disable the selected external lines */
*(__IO uint32_t *) tmp &= ~EXTI_InitStruct->EXTI_Line;
}
typedef struct
{
__IO uint32_t IMR; //偏移0
__IO uint32_t EMR;
__IO uint32_t RTSR;
__IO uint32_t FTSR;
__IO uint32_t SWIER;
__IO uint32_t PR;
} EXTI_TypeDef;
不知道是什么问题
|