【原创】关于wince驱动中CDEFINES的一些认识(作者:gooogleman)

 以前没有注意CDEFINES 这玩意,貌似在sources文件里面经常见,没注意这玩意这么强大,害的我迷茫了好一阵子,今天算是了解了他的一些作用。

【cool】学习wince 中的dirs 以及sources 文件
http://www.gooogleman.com/forum.php?mod=viewthread&tid=19552&fromuid=3

这篇文章也只是稍微的讲了一下

ADEFINES:指定汇编器要使用的参数

CDEFINES:指定编译器要使用的参数

看看PB帮助有啥说法

This macro definition specifies compiler DEFINE statements.

These DEFINE statements are added at the end of the standard DEFINE statements put in by Makefile.def.

The default value is NULL.

在S5PV210 的wince6.0摄像头驱动里面 有如下:

\SRC\DRIVERS\CAMERAFILTER\CAMERA_PDD\sources(31):CDEFINES=$(CDEFINES) -DCAMERA_PORT=CAM_B_PORT

开始我傻乎乎的寻找DCAMERA_PORT 在代码中的位置,结果找不到正常了。因为DCAMERA_PORT表示define CAMERA_PORT o(∩_∩)o 哈哈真是累死人不偿命啊。

下面是为微软的例子

To include the security module, link with authcode.lib. Insert the following code into each of the sources files that build the kernel:.

!IF "$(MODULE_CERTIFY)" == "1" 
CDEFINES=$(CDEFINES) -DMODULE_CERTIFY 
SOURCELIBS=$(SOURCELIBS) $(_OSSVCSOAKROOT)\lib\$(_CPUDEPPATH)\authcode.lib 
!ENDIF

Note that all of the code for the security module is wrapped in #ifdef MODULE_CERTIFY. The presence of MODULE_CERTIFY environment variable controls whether the flag is included or not. Smartfon.bat sets the environment variable MODULE_CERTIFY=1.

果然我在S5PV210 的wince6.0摄像头驱动里面找到了

// Get MDDContext Handler
int CameraInit(void *pData)
{
DBGMSG(CAMF_FUNC && CAMF_USR1,(TEXT("%s ++%s \n"), DBG_MSG_HEADER, _T(__FUNCTION__)));

// Open Specified Raw Camera Driver
CAF_initialize_RAW_camera_driver();

// Call Raw Camera Driver Initialization
// Only need module initialization and Buffer initialization
DWORD dwBytes;


CAMERA_MODULE_DESC CamModuleInfo;
CamModuleInfo.CamPort = (CAMIF_INPUTPORT)CAMERA_PORT;————————————————————————————就是这里了!
CamModuleInfo.ModuleName = (MODULE_SENSOR)CAMERA_MODULE_NAME;

// Request Initialization Camera module and Buffer
if ( !DeviceIoControl(g_hPreviewCamera, IOCTL_CAM_INIT, &CamModuleInfo, sizeof(CAMERA_MODULE_DESC), NULL, 0, &dwBytes, NULL) )
{
DBGMSG(CAMF_FUNC && CAMF_USR1, (_T("%s --%s() : IOCTL_CAM_INIT Failed\n\r"), DBG_MSG_HEADER, _T(__FUNCTION__)));
return FALSE;
}
if ( !DeviceIoControl(g_hVideoCamera, IOCTL_CAM_INIT, &CamModuleInfo, sizeof(CAMERA_MODULE_DESC), NULL, 0, &dwBytes, NULL) )
{
DBGMSG(CAMF_FUNC && CAMF_USR1, (_T("%s --%s() : IOCTL_CAM_INIT Failed\n\r"), DBG_MSG_HEADER, _T(__FUNCTION__)));
return FALSE;
}

DBGMSG(CAMF_FUNC && CAMF_USR1,(TEXT("%s ++%s Succeeded\n"), DBG_MSG_HEADER, _T(__FUNCTION__)));
return TRUE;
}

结束!继续看wince6.0 摄像头驱动,具体的东西请看如下帖子:

S5PV210 wince6.0 摄像头的一些进展
http://www.gooogleman.com/forum.php?mod=viewthread&tid=19584&fromuid=3

原文地址:https://www.cnblogs.com/gooogleman/p/2106348.html