This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SWI

I am trying to execute the following SWI program.
It doesnt execute the SWI function body. I have 0 errors and 0 warnings.
Any help as to why?

CODE:
#include <LPC21xx.H>

void __swi(8) Call1(int pattern);
void __SWI_8 (int pattern) //Software interrupt with passed parameters

{

IOCLR1 = 0x00FF0000; //set the leds
IOSET1 = pattern;
}

void __swi(9) Call2(void) ;
void __SWI_9 (void) //void call to software intterupt
{ IOCLR1 = 0x00FF0000; //write default pattern to the LEDs
IOSET1 = 0x00AA0000;
}

int main(void)
{ int pattern = 0x00550000;
IODIR1 = 0x00FF0000; //Set LED pins as outputs
IOCLR1 = 0x00FF0000; //Generate software interrupt

Call1(pattern) ; //call software interrupt

Call2() ; //Call second software interrupt

while(1)
{ ; //Loop forever
} }

SWI_Table FILE:

AREA SWI_TABLE, CODE, READONLY

EXPORT SWI_Count

SWI_Cnt EQU (SWI_End-SWI_Table)/4
SWI_Count DCD SWI_Cnt

IMPORT __SWI_8 IMPORT __SWI_9

; Import user SWI functions here.
; IMPORT __SWI_8

EXPORT SWI_Table
SWI_Table

; Insert user SWI functions here. SWI 0..7 are used by RTX Kernel. DCD __SWI_8 ; user SWI function DCD __SWI_9 ; user SWI function

SWI_End

END