while(1)
{
WaitForSingleObject(TimerEvent,INFINITE);
RETAILMSG(1,(TEXT("timer3::::Thread is running :times == %d\r\n"),i1));
RETAILMSG(1,(TEXT("before i1++\r\n"),i1));
i1++;
RETAILMSG(1,(TEXT("after i1++\r\n"),i1));
if(dat==0)
{
RETAILMSG(1,(TEXT("timer3::::before led light\r\n")));
v_pIOPregs->rGPFDAT &= 0xBF; //GPF6>>LED3亮
RETAILMSG(1,(TEXT("timer3::::after led light\r\n")));
dat=1;
}
else
{
RETAILMSG(1,(TEXT("timer3::::before led unlight\r\n")));
v_pIOPregs->rGPFDAT |= 0x40; //GPF6>>LED3灭
dat=0; }
}
InterruptDone(SYSINTR_TIMER3);
}
**********************************************************************************************
DWORD TIM_Init(DWORD dwContext)
{ // if you drive a idiographic device,add oter code ep: int,hardwareinit and so on
DWORD IDINTThread;
RETAILMSG(1,(TEXT("timer:::::*********InitKey_Init***********\n")));
//clear the ram which is used for this dll
就是最后加了释放
BOOL TIM_Deinit(DWORD hDeviceContext)
{ //it's a opposition to init
BOOL bRet=TRUE;
RETAILMSG(1,(TEXT("timer:::::********InitTimer_Deinit************\n")));
InterruptDisable(SYSINTR_TIMER3);