2、IST函数:
[code]while(1)
{
ret = WaitForSingleObject(hEvent_DoubleTrack, INFINITE);
if((ret==WAIT_OBJECT_0) && (g_KillDoubleThreadTrack==FALSE))
{
//RETAILMSG(MAG_DUG,(TEXT("ret==WAIT_OBJECT_0!!!\r\n")));
if (!(pGPIOregs->GPNDAT & IOSTAT_EINT8)) //EINT8 is active----->Track3
{
RETAILMSG(MAG_DUG,(TEXT("EINT8 is active----->Track3\r\n")));
if((!(pGPIOregs->GPKDAT & CP_LOW)) && (g_pBrushCard->primal_num_track3 < 1000))
{
g_pBrushCard->card_data_track3[g_pBrushCard->primal_num_track3++] = (char)(pGPIOregs->GPKDAT & TRACK3); //读出GPK2 bit
}
InterruptDone(dwSysIntr_Track3);
}
if (!(pGPIOregs->GPNDAT & IOSTAT_EINT9)) //EINT9 is active----->Track2
{
RETAILMSG(MAG_DUG,(TEXT("EINT9 is active----->Track2\r\n")));
if((!(pGPIOregs->GPKDAT & CP_LOW)) && (g_pBrushCard->primal_num_track2 < 300))
{
g_pBrushCard->card_data_track2[g_pBrushCard->primal_num_track2++] = (char)(pGPIOregs->GPKDAT & TRACK2); //读出GPK3 bit
}
InterruptDone(dwSysIntr_Track2);
}
}
}
四、曾经尝试过一个中断分别对应一个IST,但是因为两个IST之间的切换时间较长,达不到要求,才改成现在这样子,当时中断时能够正常响应的。现在不知为什么,中断进去几次后就突然不再能产生中断了。也就是“RETAILMSG(MAG_DUG,(TEXT("EINT9 is active----->Track2\r\n")));”不再打印输出了。