Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: handle an interrupt with c-code

2004-09-09 by supertoll_trinity

i found in the blinky example a way running it in c-code:

add following lines in startup.s:
 #       LDR     PC, IRQ_Addr
	LDR     PC, [PC, #-0x0FF0]     /* Vector from VicVectAddr */

# Memory Mapping (when Interrupt Vectors are in RAM)
        .equ    MEMMAP, 0xE01FC040  /* Memory Mapping Control */
.ifdef RAM_INTVEC
                LDR     R0, =MEMMAP
                MOV     R1, #2
                STR     R1, [R0]
.endif

and in my c interruptroutine:

void pos_inter (void)__attribute__((interrupt));
VICVectAddr1 = (unsigned long)trigger_inter; 

void trigger_inter (void){
	// ... do something and reset interruptflag 
	 VICVectAddr = 0;

}

so it works fine. thanks to richard.

b regards

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.