Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

compilation error "expected an identifier at line 74" in KEIL

Status
Not open for further replies.

rishi.iitk

Newbie level 3
Joined
Jul 3, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,316
friends i got the error expected an identifier at the highlighted line...plz help me..



Code:
/******************************************************************************
 *   irq.h:  Interrupt related Header file for Philips LPC214x Family 
 *   Microprocessors
 *
 *   Copyright(C) 2006, Philips Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2005.10.01  ver 1.00    Prelimnary version, first Release
 *
******************************************************************************/
#ifndef __IRQ_H 
#define __IRQ_H

/* if nested interrupt is used, NEST_INTERRUPT needs to be set to 1, otherwise 0 */
#define NESTED_INTERRUPT	1

#define I_Bit			0x80
#define F_Bit			0x40

#define SYS32Mode		0x1F
#define IRQ32Mode		0x12
#define FIQ32Mode		0x11

#define	WDT_INT			0
#define SWI_INT			1
#define ARM_CORE0_INT		2
#define	ARM_CORE1_INT		3
#define	TIMER0_INT		4
#define TIMER1_INT		5
#define UART0_INT		6
#define	UART1_INT		7
#define	PWM0_INT		8
#define I2C0_INT		9
#define SPI0_INT		10
#define	SPI1_INT		11
#define	PLL_INT			12
#define RTC_INT			13
#define EINT0_INT		14
#define EINT1_INT		15
#define EINT2_INT		16
#define EINT3_INT		17
#define	ADC0_INT		18
#define I2C1_INT		19
#define BOD_INT			20
#define ADC1_INT		21
#define USB_INT			22

#define IRQ_SLOT_EN		0x20	/* bit 5 in Vector control register */
#define VIC_SIZE		16

#define VECT_ADDR_INDEX	0x100
#define VECT_CNTL_INDEX 0x200

/* Be aware that, from compiler to compiler, nested interrupt will have to
be handled differently. More details can be found in Philips LPC2000
family app-note AN10381 */
 
/* unlike Keil Compiler, don't save and restore registers into the stack
in RVD as the compiler does that for you. See RVD ARM compiler Inline and
embedded assemblers, "Rules for using __asm and asm keywords. */
// static DWORD sysreg;		/* used as LR register */
#if NESTED_INTERRUPT 
#define IENABLE __asm { MRS LR, SPSR } \
				__asm { STMFD SP!, {LR} } \
				__asm { MSR CPSR_c, #SYS32Mode } \
				__asm { STMFD SP!, {LR} }
#else
#define IENABLE ;	/* do nothing */
#endif

#if NESTED_INTERRUPT
#define IDISABLE	__asm { LDMFD SP!, {LR} } \ 
					[COLOR="#0000FF"]__asm { MSR CPSR_c, (#IRQ32Mode|I_Bit) } \[/COLOR]
					__asm { LDMFD SP!, {LR} } \
					__asm { MSR SPSR_cxsf, LR }
#else
#define IDISABLE ;	/* do nothing */
#endif

void init_VIC( void );
DWORD install_irq( DWORD IntNumber, void *HandlerAddr );
DWORD uninstall_irq( DWORD IntNumber );

#endif /* end __IRQ_H */

/******************************************************************************
**                            End Of File
******************************************************************************/
 

Maybe the assembler isn't smart enough to do a bitwise OR operation "#IRQ32Mode|I_Bit".
Just a guess, I've never used Keil. Anyway, different assemblers tend to support
different syntax and different levels of friendliness (not as friendly as C compilers).
Try it without the OR operation?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top