载入中...

公告
载入中...

我的分类(专题)

载入中...


最新日志
载入中...

最新回复
载入中...

留言板
载入中...

统计
载入中...

链接

载入中...


<meta name="verify-v1" content="hSKR+iw6UvoD68VWdtcltdbdhWZenChrX9XGDxU33Y4=" />

arm7 中断
net_hawk 发表于 2008-7-17 11:34:00

/*=====================================================================================
Enabling and disabling interrupts
Interrupts are enabled or disabled by reading the CPSR flags and updating bit 7.
Example 4-2 shows how this can be done by using small functions that can be inlined.
These functions work only in a privileged mode, because the control bits of the CPSR
and SPSR cannot be changed when in User mode.
====================================================================================*/


void enable_IRQ(void)
{
    int tmp;
    __asm
    {
        MRS tmp, CPSR
        BIC tmp, tmp, #0x80
        MSR CPSR_c, tmp
    }
}

void disable_IRQ(void)
{
    int tmp;
    __asm
    {
        MRS tmp, CPSR
        ORR tmp, tmp, #0x80
        MSR CPSR_c, tmp
    }
}


阅读全文 | 回复(0) | 引用通告 | 编辑

发表评论:
载入中...