/*=====================================================================================
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
}
}