HWI的ISR:
Void FpgaDioTxCompletionIsr
(
UArg argument
//UArg arg0, UArg arg1
)
{
Uint16 doorbellStatus;
/* Pass the control to the driver DIO Tx Completion ISR handler */
//Srio_dioTxCompletionIsr ((Srio_DrvHandle)argument, hSrioCSL);//该行代码DSP应用程序通过直接io方式发送数据时,由中断ISR调用
//FPGA中断足够快的话是否会丢失中断?
//g_InterruptCount++;
CSL_SRIO_GetDoorbellPendingInterrupt (hSrioCSL, 0, &doorbellStatus);
CSL_SRIO_ClearDoorbellPendingInterrupt (hSrioCSL, 0, doorbellStatus);
//UInt32 uiSegNum;
switch(doorbellStatus)
{
case 1:
// printf("doorbell 1 ok!");
// WriteFpgaByDioSockets(0x00000000, (Uint8*)0xA0000000,8);
//SRIO_DIO_Task(0,1);
Semaphore_post(Sem_Srio);
break;
case 2:
printf("doorbell 2 ok!");
break;
case 4:
//System_printf("doorbell 4 ok!");
break;
case 8:
printf("doorbell 8 ok!");
break;
case 16:
printf("doorbell 16 ok!");
break;
case 32:
printf("doorbell 32 ok!");
break;
case 64:
printf("doorbell 64 ok!");
break;
case 128:
printf("doorbell 128 ok!");
break;
default:
printf("doorbell not ok!");
break;
}
// System_printf("waiting for doorbell!\n");
return;
}
任务:
Void SRIO_DIO_Task(UArg arg0, UArg arg1)
{
while(1)
{
Semaphore_pend(Sem_Srio,BIOS_WAIT_FOREVER);
WriteFpgaByDioSockets(0x00000000, (Uint8*)0xA0000000,8);
}
}
任务和信号量的创建:
var Sem = xdc.useModule('ti.sysbios.knl.Semaphore');
Program.global.Sem_Srio = Sem.create(0);
Program.global.Sem_Srio.mode = Sem.Mode_COUNTING;
Program.global.semSuspend = Sem.create(0);
Program.global.semSuspend.mode = Sem.Mode_COUNTING;
Program.global.semRestart = Sem.create(0);
Program.global.semRestart.mode = Sem.Mode_COUNTING;
var task0Params = new Task.Params();
task0Params.instance.name = "task0";
task0Params.priority = 3;
Program.global.task0 = Task.create("&SRIO_DIO_Task", task0Params);
Nancy Wang:
完整的报错信息贴出来看一下。