We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi;
for nested interrupt i am using following code available in CARM tutorial
#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 */ \
I am declaring this macro in my UART header file and using it in my interrupt routine code as follows
void UARTISR (void) __irq {
IENABLE; / / / code; /
IDISABLE; }
but while compiling mu code .i get following compilation error
uart.h(35): error: #40: expected an identifier uart.h(35): error: #666: "asm" must be used with a function definition uart.h(35): error: #65: expected a ";" uart.h(35): error: #7: unrecognized token uart.h(36): error: #7: unrecognized token uart.h(37): error: #10: "#" not expected here uart.h(37): error: #7: unrecognized token uart.h(38): error: #7: unrecognized token uart.h(40): error: #7: unrecognized token uart.h(41): error: #10: "#" not expected here uart.h(41): error: #7: unrecognized token uart.h(42): error: #7: unrecognized token uart.h(43): error: #7: unrecognized token
can anyone know what is this error for?
maybe you are using the RealView compiler. See here then: http://www.keil.com/support/docs/3353.htm