在线时间0 小时
UID176538
ST金币0
蝴蝶豆0
注册时间2008-3-5
新手上路
- 最后登录
- 1970-1-1
|
a0a.1 0b0c
最近测试STM32的UCOS外中断,发现了一个有意思的问题,设定的下降沿中断,结果在输入的很多上升沿也中断了,而且当2个外中断同时到来时,会有一个中断丢失(不执行),请大家帮忙看一下:
中断输入是PD3,PB12,PB13
输入配置
GPIOA->CRH=0x44444440;
GPIOB->CRL=0x33333433;
GPIOB->CRH=0x44444333;
GPIOC->CRL=0x44444444;
GPIOC->CRH=0x44344B44;
GPIOD->CRL=0x44444444;
GPIOD->CRH=0x44444444;
GPIOE->CRL=0x33333333;
中断配置:
AFIO->EXTICR[3]=0x0011; //15 14 13 12 //0a1b2c
AFIO->EXTICR[2]=0x0000; //11 10 9 8
AFIO->EXTICR[1]=0x0000; //7 6 5 4
AFIO->EXTICR[0]=0x3000; //3 2 1 0
EXTI->FTSR=0x3008;
EXTI->RTSR=0;
EXTI->IMR= 0x3008;
EXTI->EMR= 0x3008;
MY_NVIC_Init(4,0,EXTI3_IRQChannel,4);
MY_NVIC_Init(5,0,EXTI15_10_IRQChannel,4);
中断程序:
void EXTI3_IRQHandler(void)
{
//OSIntEnter();
if (EXTI->R & (1 |
|