#define IENABLE /* Nested Interrupts Entry */ \
__asm { MRS LR, SPSR } /* Copy SPSR_irq to LR */ \
__asm { STMFD SP!, {LR} } /* Save SPSR_irq */ \
__asm { MSR CPSR_c, #0x1F } /* Enable IRQ (Sys Mode) */ \
__asm { STMFD SP!, {LR} } /* Save LR */ \
#define IDISABLE /* Nested Interrupts Exit */ \
__asm { LDMFD SP!, {LR} } /* Restore LR */ \
__asm { MSR CPSR_c, #0x92 } /* Disable IRQ (IRQ Mode) */ \
__asm { LDMFD SP!, {LR} } /* Restore SPSR_irq to LR */ \
__asm { MSR SPSR_cxsf, LR } /* Copy LR to SPSR_irq */ \
为什么编译不过呢?出现以下问题。用的是MDK4.03A
Intrp.c(61): error: #20: identifier "LR" is undefined
Intrp.c(61): error: #20: identifier "SP" is undefined
Intrp.c(61): error: #20: identifier "LR" is undefined
Intrp.c(61): warning: #1287-D: LDM/STM instruction may be expanded
Intrp.c(61): error: #20: identifier "SP" is undefined
Intrp.c(61): error: #20: identifier "LR" is undefined |