Hi,
I have some trouble in my project about creating SWI in my code rather than insert SWI in dsp/bios tcf .
Description:
in the swi.h , there have define some structs like:
typedef struct SWI_Obj {
Int lock;
Ptr ready;
Uns mask;
Ptr link;
Uns initkey;
Uns mailbox;
FXN_Obj fxnobj;
Int stslock;
STS_Obj *sts; /* pointer to STS_Obj */
} SWI_Obj;
typedef struct SWI_Obj *SWI_Handle;
typedef struct SWI_Attrs {
SWI_Fxn fxn;
Arg arg0;
Arg arg1;
Int priority;
Uns mailbox;
} SWI_Attrs;
Now, here is my code:
#include<stdio.h>
#include<log.h>
#include<swi.h>
#include<sys.h>
#include "switestcfg.h"
void swiFxn3(void);
SWI_Handle swi;
SWI_Attrs *attrs;
void main()
{ SWI_Attrs nmm = {(SWI_Fxn)swiFxn3,0,0,3,0};
attrs = &nmm;
swi=SWI_create(attrs);
SWI_post(swi);
}
void swiFxn3()
{
LOG_printf(&trace,"it's my interrupt\n");
}
I find that it doesn't go to the LOG_printf(); in the other word, the swi may not be create successful .
please help me ,and tell me how to do for this. and if something I neglect ?