请问各位大虾们,我用的三星原版4510的评估版编了一个外中断测试程序,可怎么也进不了中断,请大虾们指点
/* ISR_test.c */
#include "vxWorks.h"
#include "intLib.h"
#include "taskLib.h"
#include "iv.h"
#include "logLib.h"
/*function prototype*/
void interruptHandler(int);
void interruptCatcher(void);
/*globals */
#define INTERRUPT_NUM 2
#define INTERRUPT_LEVEL 65
#define ITER1 40
#define LONG_TIME 1000000
#define PRIORITY 100
#define ONE_SENCOND 100
#define INT_LVL_EXTINT0 0 /* External Interrupt0 */
#define INT_VEC_EXTINT0 IVEC_TO_INUM(INT_LVL_EXTINT0) /* External Interrupt0*/
void IsrTest(void)
{
int i,j,taskId,priority;
STATUS taskAlive;
if((taskId=taskSpawn("interruptCatcher",PRIORITY,0x100,20000,(FUNCPTR)interruptCatcher,0,0,0,0,0,0,0,0,0,0))==ERROR)
logMsg("taskSpawn interCatcher failed\n",0,0,0,0,0,0);
for(i=0;i<ITER1;i++)
{
taskDelay(ONE_SENCOND);
if((taskAlive=taskIdVerify(taskId))==OK)
{
logMsg("++++++++interrupt generated\n",0,0,0,0,0,0);
/*if(sysBusIntGen(INTERRUPT_NUM,INTERRUPT_LEVEL)==ERROR)
logMsg("interrupt not generated\n",0,0,0,0,0,0);*/
}
else
break;
}
logMsg("\n*****************interruptGenerator exited **********\n\n\n\n",0,0,0,0,0,0);
}
void interruptCatcher(void)
{
int i,j;
STATUS connected;
if((connected=intConnect ( ( VOIDFUNCPTR * )INUM_TO_IVEC(INT_LVL_EXTINT0), (VOIDFUNCPTR)interruptHandler, i ) )==ERROR)
logMsg("intConnect failed\n",0,0,0,0,0,0);
/*使能这中断 */
if(intEnable (INT_LVL_EXTINT0)==ERROR)
logMsg("intEnable fail \n",0,0,0,0,0,0);
INTMASK=0x0;
for(i=0;i<ITER1;i++)
{
for(j=0;j<LONG_TIME;j++);
logMsg("Normal processing in interruptCatcher\n",0,0,0,0,0,0);
}
logMsg("\n++++++++++++interruptCatcher exited +++++\n",0,0,0,0,0,0);
}
void interruptHandler(int arg)
{
int i;
logMsg("--------------interrupt caught\n",0,0,0,0,0,0);
for(i=0;i<5;i++)
logMsg("interrupt processing\n",0,0,0,0,0,0);
}