|
我在ICOP的X86板子上使用驱动程序处理GPIO中断,设置为低电平触发。问题是我把引脚接到低电平时,就会不停地触发中断,IST是这样写的:
DWORD WINAPI ISTThread(LPVOID lpv)
{
PIST_INFO IstData = (PIST_INFO) lpv;
DWORD Result;
int Cnt = 0;
InterruptDone(IstData->SysIntr);
while(!IstData->IstQuit) {
Result = WaitForSingleObject(IstData->hEvent,INFINITE);
if (IstData->IstQuit) {
wprintf(_T("Quit IST\n"));
break;
}
if (WAIT_OBJECT_0 == Result) {
if (!IstData->IstQuit) {
//输出中断产生信息
wprintf(_T("GPIO Interrupt occured[%d]\b\r"),Cnt++);
InterruptDone(IstData->SysIntr);
DisableIntr(0xdc);
DisableIntr(0xe0);
}
else {
wprintf(_T("Quit IST\n"));
break;
}
}
}
SetEvent(IstData->hEvent);
wprintf(_T("Quit IST\n"));
return 0;
}
还请各位高手指点迷津,谢谢。
|
|