首先在backlight驱动中添加相关代码,实现动画效果,代码如下。
void slash()
{
char *logo[2];
int i;
HANDLE hEvent;
DWORD dwRet;
char *pLCDBuf;
pLCDBuf = (char*)VirtualAlloc(NULL,0x100000,MEM_RESERVE,PAGE_NOACCESS);
VirtualCopy(pLCDBuf, (void *)(0x33f00000/256), 0x100000, PAGE_READWRITE | PAGE_PHYSICAL | PAGE_NOCACHE);
logo[0] = (char*)gImage_gbug;
logo[1] = (char*)gImage_hb;
hEvent = CreateEvent(NULL,FALSE,FALSE,_T("STOPSLASH"));
i = 0;
while (1)
{
dwRet = WaitForSingleObject(hEvent,810);
if (dwRet == WAIT_OBJECT_0)
{
break;
}
else if(dwRet == WAIT_TIMEOUT)
{
memcpy(pLCDBuf,logo[i],640*480*2);
i = !i;
}
}
}
DWORD
BKL_Init( DWORD /*registryPath*/ )
{
CreateThread(0,0,(LPTHREAD_START_ROUTINE)slash,0,0,NULL);
return 1;
}
2 SetEvent(hEvent);
3 CloseHandle(hEvent);