打印

2410不开中断却中断,这是为什么???

[复制链接]
1806|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
52mcu|  楼主 | 2007-5-28 21:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
一下为三星的中断测试代码
未见有将cpsr中的IRQ中断屏蔽为I请零的操作。却能中断,这是为什么?????




void Test_Eint(void)
{
    int i;
    int extintMode;

    Uart_Printf("[External Interrupt Test through PF0/2/11/19]\n");

    Uart_Printf("1.L-LEVEL  2.H-LEVEL  3.F-EDGE  4.R-EDGE  5.B-EDGE\n");
    Uart_Printf("Select the external interrupt type.\n");
    extintMode=Uart_Getch();

    //extintMode='3';
    rGPFCON = (rGPFCON & 0xffcc)|(1<<5)|(1<<1);        //PF0/2 = EINT0/2
    rGPGCON = (rGPGCON & 0xff3fff3f)|(1<<23)|(1<<7);    //PG3/11 = EINT11/19
     
    switch(extintMode)
    {
    case '1':
        rEXTINT0 = (rEXTINT0 & ~((7<<8)  | (0x7<<0))) | 0x0<<8 | 0x0<<0; //EINT0/2=low level triggered
    rEXTINT1 = (rEXTINT1 & ~(7<<12)) | 0x0<<12; //EINT11=low level triggered
    rEXTINT2 = (rEXTINT2 & ~(7<<12)) | 0x0<<12; //EINT19=low level triggered
        break;
    case '2':
        rEXTINT0 = (rEXTINT0 & ~((7<<8)  | (0x7<<0))) | 0x1<<8 | 0x1<<0; //EINT0/2=high level triggered
    rEXTINT1 = (rEXTINT1 & ~(7<<12)) | 0x1<<12; //EINT11=high level triggered
    rEXTINT2 = (rEXTINT2 & ~(7<<12)) | 0x1<<12; //EINT19=high level triggered
        break;
    case '3':
        rEXTINT0 = (rEXTINT0 & ~((7<<8)  | (0x7<<0))) | 0x2<<8 | 0x2<<0; //EINT0/2=falling edge triggered
    rEXTINT1 = (rEXTINT1 & ~(7<<12)) | 0x2<<12; //EINT11=falling edge triggered
    rEXTINT2 = (rEXTINT2 & ~(7<<12)) | 0x2<<12; //EINT19=falling edge triggered
        break;
    case '4':
        rEXTINT0 = (rEXTINT0 & ~((7<<8)  | (0x7<<0))) | 0x4<<8 | 0x4<<0; //EINT0/2=rising edge triggered
    rEXTINT1 = (rEXTINT1 & ~(7<<12)) | 0x4<<12; //EINT11=rising edge triggered
    rEXTINT2 = (rEXTINT2 & ~(7<<12)) | 0x4<<12; //EINT19=rising edge triggered
         break;
    case '5':
        rEXTINT0 = (rEXTINT0 & ~((7<<8)  | (0x7<<0))) | 0x6<<8 | 0x6<<0; //EINT0/2=both edge triggered
    rEXTINT1 = (rEXTINT1 & ~(7<<12)) | 0x6<<12; //EINT11=both edge triggered
    rEXTINT2 = (rEXTINT2 & ~(7<<12)) | 0x6<<12; //EINT19=both edge triggered
        break;
    default:
        break;
    }

    Uart_Printf("Press the EINT0/2/11/19 buttons or Press any key to exit.\n");

    pISR_EINT0=(U32)Eint0Int;
    pISR_EINT2=(U32)Eint2Int;
    pISR_EINT8_23=(U32)Eint11_19;

    rEINTPEND = 0xffffff;
    rSRCPND = BIT_EINT0|BIT_EINT2|BIT_EINT8_23; //to clear the previous pending states
    rINTPND = BIT_EINT0|BIT_EINT2|BIT_EINT8_23;
    
    rEINTMASK=~( (1<<11)|(1<<19) );
    rINTMSK=~(BIT_EINT0|BIT_EINT2|BIT_EINT8_23);
        
    Uart_Getch();
    
    rEINTMASK=0xffffff;
    rINTMSK=BIT_ALLMSK;
}

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

157

主题

292

帖子

0

粉丝