Discussion Forum

nested interrupt problem

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
MOHD ARIF KHAN
Posted
1-Dec-2008 05:39 GMT
Toolset
ARM
New! nested interrupt problem

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?

Read-Only
Author
Reinhard Keil
Posted
1-Dec-2008 06:46 GMT
Toolset
ARM
New! RE: nested interrupt problem

maybe you are using the RealView compiler. See here then:
http://www.keil.com/support/docs/3353.htm

Next Thread | Thread List | Previous Thread Start a Thread | Settings