请教各位大神,以下这两个关于中断的函数,有什么区别?它们不都是获取中断的标志位吗?为什么要定义两个函数?
FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line)
{
FlagStatus bitstatus = RESET;
/* Check the parameters */
assert_param(IS_GET_EXTI_LINE(EXTI_Line));
if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
}
ITStatus EXTI_GetITStatus(uint32_t EXTI_Line)
{
ITStatus bitstatus = RESET;
uint32_t enablestatus = 0;
/* Check the parameters */
assert_param(IS_GET_EXTI_LINE(EXTI_Line));
enablestatus = EXTI->IMR & EXTI_Line;
if (((EXTI->PR & EXTI_Line) != (uint32_t)RESET) && (enablestatus != (uint32_t)RESET))
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
}
(2)如果PA6和PB6引脚都发生电平跳跃,EXTI6中断被触发了,我想知道是PA6还是PB6触发的中断,怎么看啊?
(3)如果PA6引脚触发EXTI6中断,在执行中断子程序过程中如果PE6按键被按下了会如何? |