大哥们#if 0 #if 1怎用使用,小弟这边有礼了
各位大哥有那位使用个这样的宏呀,书上好像没有介绍呀 #if 0 #if 1
#if 0 /* No osd int */
if ((cardIn && (param == SP5K_DRIVE_SD)) || ((cardIn == 0) && (param == SP5K_DRIVE_NAND))) {
evbOsdInit();
powerOnReady = 1;
sp5kExifInit();
if (vbusIn) {
printf("Start to connect USB now!!\n");
USB_CONNECT();
}
}
#endif
/* Jinch 060420 add start */
customAppMsgSend ( msgId , param );
/* Jinch 060420 add end */
break;
case SP5K_MSG_DISK_MOUNT_FAIL:
printf("Mount drive %d fail\n",param );
/* Jinch 060420 add start */
customAppMsgSend ( msgId , param );
/* Jinch 060420 add end */
break;
#if 1
case SP5K_MSG_USB_DEVICE_VBUS_IN:/*zyb modify for sd and usb 0520*/
printf("\n*SP5K_MSG_USB_DEVICE_VBUS_IN*\n");
SP5KPMP_AutoPowerOff_Public_Api(AUTOPOWEROFF_DISABLE);
SP5KPMP_Usb_State = USB_Status_PlugIn;
sp5kModeGet(&mode);
if((SP5K_MODE_STILL_PREVIEW == mode) || (SP5K_MODE_STILL_SNAP == mode) || (SP5K_MODE_VIDEO_PREVIEW == mode) || (SP5K_MODE_VIDEO_RECORD == mode))
{
;
}
else if(SP5K_MODE_VIDEO_PLAYBACK == mode)
{
SP5KPMP_Lock_usb_KeyFlag = 1;
customAppMsgSend ( msgId , param );
}
else
{
SP5KPMP_Lock_usb_KeyFlag = 1;
if(0 == SP5KPMP_Open_Src)
{
SP5KPMP_Usb_ModeSet(USB_MODE_MSDC);
SP5KPMP_Open_Src = 0;
}
customAppMsgSend ( msgId , param );
}
break;
break;
case SP5K_MSG_USB_DEVICE_VBUS_OFF:
printf("\n*SP5K_MSG_USB_DEVICE_VBUS_OFF*\n");
SP5KPMP_AutoPowerOff_Public_Api(AUTOPOWEROFF_ENABLE);
SP5KPMP_Usb_State = USB_Status_PlugOut;
SP5KPMP_Open_Src = 0;
SP5KPMP_Path_Init();
sp5kModeGet(&mode);
if((SP5K_MODE_STILL_PREVIEW == mode) || (SP5K_MODE_STILL_SNAP == mode) || (SP5K_MODE_VIDEO_PREVIEW == mode) || (SP5K_MODE_VIDEO_RECORD == mode))
{
;
}
else
{
SP5KPMP_Lock_usb_KeyFlag = 0;
SP5KPMP_Usb_State = USB_Status_PlugOut;
sp5kDispDevAttrSet(SP5K_DISP_OSD_ACTIVE, 1, 0, 0, 0);
customAppMsgSend ( msgId , param );
}
break;
#endif
case SP5K_MSG_MODE_RADY:
/*printf("MODE RDY\n");*/
break;
#if 1
case SP5K_MSG_AE_READY:
{
aeResult_t aeResult;
SINT32 expidx, step, nextexp;
UINT32 ret,agcidx, nextagc;
ret = sp5kAePreviewResultGet(param,&aeResult);
if (ret != SUCCESS ||
!(aeResult.valid & AAA_INFO_RESULT_AE_VALID)) {
printf("ae result overrun\n");
} else {
/***TODO****DO NOT use fixed numbers*/
/***TODO****evinfo != evsync???*/
expidx = aeResult.evInfo.expIdx;
agcidx = aeResult.evInfo.agcIdx;
step = aeResult.aeStep;
if (expidx == 80) {
nextexp = expidx;
if ((SINT32)agcidx < step) nextagc = 0;
else nextagc = agcidx - step;
if (nextagc > 120) nextagc = 120;
else if (nextagc < 90) {
nextexp = 80+90-agcidx+step;
nextagc = 90;
if (nextexp > 144) nextexp=144;
}
} else {
nextexp = expidx + step;
nextagc = agcidx;
if (nextagc < 90) {
nextexp += 90 - nextagc;
nextagc = 90;
}
if (nextexp > 144) {
nextexp = 144;
} else if (nextexp < 80) {
nextagc = agcidx +80 - nextexp;
nextexp = 80;
if (nextagc > 120) nextagc=120;
}
}
if (expidx == nextexp)
nextexp = SP5K_AE_EXP_AGC_DONT_CHANGE;
if (agcidx == nextagc)
nextagc = SP5K_AE_EXP_AGC_DONT_CHANGE;
sp5kPreviewExpAgcSet(nextexp,nextagc);
}
break;
}
#endif