EXIT2不符合条件,执行EXIT3后符合条件,但是为什么当时就执行EXIT2了
void EXTI2_IRQHandler(void)//ÓÃÓÚÆô¶¯µÄÍⲿÖжÏÊäÈë
{
if(shut==0)
{
printf("´Æô¶¯ý:%d ´Î
",zzz);//Êä³öƵÂÊ
GPIO_ResetBits(GPIOB,GPIO_Pin_5); //½â³ýɲ³µ
GPIO_ResetBits(GPIOB,GPIO_Pin_8); //ʹÄÜEN
GPIO_ResetBits(GPIOB,GPIO_Pin_1); //PB1ΪµÍµçƽ£¬¼ÌµçÆ÷ÎüºÏ£¬Â̵ÆÁÁ
dacval=0;
while(dacval<4000)
{
ti++;
if(ti==10) //¶¨Ê±Ê±¼äµ½ÁË
{
dacval+=200;
DAC_SetChannel1Data(DAC_Align_12b_R, dacval);
printf("dacval:%d ´Î
",dacval);//Êä³ödacval
ti=0;
}
delay_ms(10);
}
EXTI_ClearITPendingBit(EXTI_Line2);
}
}
void EXTI3_IRQHandler(void)//ÓÃÓÚ¼±Í£µÄÖжÏÊäÈë
{
shut=1;
DAC_SetChannel1Data(DAC_Align_12b_R, 0); //³õʼ»¯SVÊäÈë0V
GPIO_SetBits(GPIOB,GPIO_Pin_5);
printf("´ý:%d ´Î
",shut);//²âÊÔ
GPIO_SetBits(GPIOB,GPIO_Pin_1); //PB1ΪµÍµçƽ£¬¼ÌµçÆ÷¶Ï¿ª£¬Â̵ÆÃð
EXTI_ClearITPendingBit(EXTI_Line3);
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>