My device needs some high precision time measurements. So I tried to setup the onboard Timer3 to interrupt one of my device drivers.
To enable Timer3 my driver sets Bit 6 and 7 of CONTROL3 to high and it writes the initial value to the LOAD3 register.
I also set the corresponding Bit (Bit 22) in the Interrupt Controller Enable Set Register (INTENS) to one.
How I understand should timer3 run periodicly now and throw an interrupt every cycle.
In order to connect this event to an interrupt service thread in my driver
I have the following code:
Quote:
DWORD dwIntr = 22;
pds->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &dwIntr,sizeof( dwIntr ),&pds->sysIntr, sizeof(pds->sysIntr),NULL ))
{
DEBUGMSG(ZONE_ERROR, (_T("Init failed: KernelIOControl\r\n")));
return 0;
}
if (!InterruptInitialize(pds->sysIntr, pds->hEvent, NULL, 0))
{
DEBUGMSG(ZONE_ERROR, (_T("Init failed: InterruptInitialize\r\n")));
return 0;
}
pds->hThread = CreateThread(NULL,0,&GPIO_IST, pds, 0, NULL);
This basicly works fine and everything seems to be initialized right.
But my IST waits forever and no interrupt is catched the at all.
I am relatively new to Windows CE programming so maybe I am doing an easy mistake.
I hope maybe one of you can point me in the right direction.
Thanks for your help
Bernhard