重新看一遍backlight背光驱动
发现几个问题请教各位:
1、pBKLinfo->hCoreDll = LoadLibrary(TEXT("coredll.dll"));
if (NULL != pBKLinfo->hCoreDll)
{
pBKLinfo->pfnGetSystemPowerStatusEx2 = (PFN_GetSystemPowerStatusEx2)
GetProcAddress(pBKLinfo->hCoreDll, TEXT("GetSystemPowerStatusEx2"));
}
这里重新load了coredll.dll是为了调用GetSystemPowerStatusEx2这个函数,但是在sources文件中
已经加载了coredll.dll
为什么还需要动态load??
2、在BKL_MDD_INFO结构体中有:
BOOL fBatteryTapOn; // reg setting - do we turn on when screen/button tapped?
BOOL fExternalTapOn; // reg setting - do we turn on when screen/button tapped?
这两个变量的作用是什么??是否跟触摸TOUCH唤醒背光有关??
3、在UpdateBacklight(BKL_MDD_INFO *pBKLinfo, DWORD dwReason)函数中
// 'Tap On' settings just unchecked or 'Turn off backlight' timer option just selected:
fSetPowerOff = ( ((dwTimeoutPrev != TURNOFFIMMEDIATELY) && (dwTimeoutNew == TURNOFFIMMEDIATELY)) \
|| ((fTapOnPrev && !fTapOnNew)));
// 'Tap On' setting just checked or 'Turn off backlight' timer option just deselected: fReleasePwrOff = (((dwTimeoutPrev == TURNOFFIMMEDIATELY) && (dwTimeoutNew != TURNOFFIMMEDIATELY) ) \
|| (!fTapOnPrev && fTapOnNew));
if(fSetPowerOff)
{
BKL_SetDevicePower(pBKLinfo, D4);
}
else if (fReleasePwrOff)
{
BKL_SetDevicePower(pBKLinfo, PwrDeviceUnspecified);
}
这是在做什么???
4、一直不知道这个背光驱动中当背光被设置到D4状态时,是怎么响应点击触摸屏或按键或USB、SDCARD插入事件的
------解决方案--------------------
1、pBKLinfo->hCoreDll = LoadLibrary(TEXT("coredll.dll"));
if (NULL != pBKLinfo->hCoreDll)
{
pBKLinfo->pfnGetSystemPowerStatusEx2 = (PFN_GetSystemPowerStatusEx2)
GetProcAddress(pBKLinfo->hCoreDll, TEXT("GetSystemPowerStatusEx2"));
}
这里重新load了coredll.dll是为了调用GetSystemPowerStatusEx2这个函数,但是在sources文件中
已经加载了coredll.dll
为什么还需要动态load??
要取得coredll.dll的句柄就要执行LOADLIBRARY.要不怎么应用GetProcAddress函数呢?