//ethan_20110801_add ER Cal_ShowCalRst(void) { ER ercode = 0; FLGPTN uiFlag = 0; ercode = Cal_ReadCalData(); if(ercode!=E_OK) { debug_err(("^R %s: read ps error\r\n",__func__)); return E_SYS;; } Cal_ClearOSD(_OSD_INDEX_TRANSPART); if((AAA_Adjust.DP_Status.Prv_White == _Prv_W_Status) && \ (AAA_Adjust.DP_Status.Prv_Black== _Prv_B_Status)) { sprintf(CalStringBuffer,"DP Pixel num: Prv:%d",(UINT)AAA_Adjust.DPC_Num[DPC_PRV]); Cal_ShowStringWithColor(CalStringBuffer,20, 20, 4); } if((AAA_Adjust.DP_Status.Cap_White == _Cap_W_Status) && \ (AAA_Adjust.DP_Status.Cap_Black == _Cap_B_Status)) { sprintf(CalStringBuffer,"DP Pixel num: Cap:%d",(UINT)AAA_Adjust.DPC_Num[DPC_CAP]); Cal_ShowStringWithColor(CalStringBuffer,20, 40, 4); } if(AAA_Adjust.ECS_Status == _ECS_Status) sprintf(CalStringBuffer,"ECS Rst: OK"); else sprintf(CalStringBuffer,"ECS Rst: NG"); Cal_ShowStringWithColor(CalStringBuffer,20, 60, 4); if(AAA_Adjust.AWB_Status == _AWB_Status) sprintf(CalStringBuffer,"AWB: Rgain:%d Bgain:%d",AAA_Adjust.AWB.Rgain,AAA_Adjust.AWB.Bgain); else sprintf(CalStringBuffer,"AWB: NG"); Cal_ShowStringWithColor(CalStringBuffer,20, 80, 4); if(AAA_Adjust.AWBGS_Status == _AWB_Status) sprintf(CalStringBuffer,"AWB GS: Rgain:%d Bgain:%d",AAA_Adjust.AWBGS.Rgain,AAA_Adjust.AWBGS.Bgain); else sprintf(CalStringBuffer,"AWBGS: NG"); Cal_ShowStringWithColor(CalStringBuffer,20, 100, 4); sprintf(CalStringBuffer,"Press SHUTTER to return"); Cal_ShowStringWithColor(CalStringBuffer,20, 120, 4); clr_flg(FLG_ID_KEY, FLGKEY_SHUTTER2); wai_flg(&uiFlag, FLG_ID_KEY, FLGKEY_SHUTTER2, TWF_ORW | TWF_CLR); return E_OK; }
/** Initialize voltage detection Initialize voltage detection for battery and flash @param void @return void */ void VolDet_Init(void) { if (adc_open(VOLDET_FLASH_ADC_CH) != E_OK) { debug_err(("VOLDET ERR: Can't open ADC channel for flash detection\r\n")); return; } // Set mode for flash voltage detection adc_setMode(VOLDET_FLASH_ADC_CH, TRUE, FALSE, NULL); // Enable adc control logic adc_enable(); }
static INT32 UIFlowWndPhoto_OnExeZoomIn(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { UINT32 uiEvtKeyAct = 0; if(paramNum > 0) uiEvtKeyAct = paramArray[0]; switch(uiEvtKeyAct) { case NVTEVT_KEY_PRESS: case NVTEVT_KEY_CONTINUE: if (DZOOM_IDX_GET() > DZOOM_IDX_MAX()) { Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_STOP, UI_GetData(FL_Dzoom)); gPhotoData.State &= ~PHOTO_ST_ZOOM; return NVTEVT_CONSUME; } switch(gPhotoData.State) { case PHOTO_ST_VIEW: case PHOTO_ST_VIEW|PHOTO_ST_ZOOM: /* set Digital Zoom interface */ UI_SetData(FL_ZoomIFIndex,ZOOM_IF_DIGITAL); /* * Suspend all keys while keep ZoomIn pressed. * Gotta resume them after ZoomIn key released. */ Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL); FlowPhoto_ForceLockFdSd(); gPhotoData.State |= PHOTO_ST_ZOOM; Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_IN,UI_GetData(FL_Dzoom)); break; } break; case NVTEVT_KEY_RELEASE: Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_STOP,UI_GetData(FL_Dzoom)); gPhotoData.State &= ~PHOTO_ST_ZOOM; FlowPhoto_SetFdSdProc(FlowPhoto_GetSDStatus()); /* Resume keys after ZoomIn released */ Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress); break; default: debug_err(("UIFlowWndPhoto_OnKeyZoomin: Unknown evt 0x%x\r\n", uiEvtKeyAct)); break; } return NVTEVT_CONSUME; }
void MsdcNvtCb_LcdGetFreeMem(void* pData) { tMSDCEXT_LCD_DRV_MEM_POOL_GET* pDesc = BEGIN_MSDC_NVT_CB(tMSDCEXT_LCD_DRV_MEM_POOL_GET,pData); if(pDesc==NULL) { debug_err(("MsdcNvtCb_LcdGetFreeMem(): is failed!\r\n")); return; } get_blk((void *)&pDesc->PoolAddr, POOL_ID_CAPTURE); rel_blk(POOL_ID_CAPTURE, (VP)pDesc->PoolAddr); pDesc->PoolSize = POOL_SIZE_CAPTURE; pDesc->tParent.bOK = TRUE; }
void Cal_DPinBurnIn(BOOL checkStatus) { ALG_CAL_PARAM CalParam; if( (checkStatus) && (AAA_Adjust.DP_Status.Prv_Black==_Prv_B_Status)&&(AAA_Adjust.DP_Status.Cap_Black==_Cap_B_Status) ) { char StringBuf[64]; sprintf(StringBuf,"dark pixel ok \r\n"); debug_err(("%s \r\n",StringBuf)); Cal_ShowString(StringBuf, &BurnInStringRect, TRUE); debug_err(("warn pixel ok \r\n")); return ; } else { char StringBuf[64]; sprintf(StringBuf,"n warn dark defect pixel \r\n"); debug_err(("%s \r\n",StringBuf)); Cal_ShowString(StringBuf, &BurnInStringRect, TRUE); debug_err(("rn warn dark defect pixel \r\n")); } // Close all task AppInit_Close(); CalParam.FnShowString = Cal_ShowRectStringWithColor; CalParam.MemoryAddr = Cal_GetMemoryAddr(); CalParam.MemorySize = Cal_GetMemorySize(); Alg_Cal(CAL_DEFECTPIXEL_DARK, &CalParam); //change back to photo mode Primary_ChangeMode(PRIMARY_MODE_PHOTO); }
UINT32 Cal_GetDefaultCal(INT8 * pFileName) { #if 0 UINT32 itemNum = 0; UINT32 pCalTxtBuf; UINT32 filesize = 5*1024; SysGetSICDAddr(&pCalTxtBuf); memset((char *)pCalTxtBuf,0,256); FilesysWaitInitFinish(FST_TIME_INFINITE); if(FilesysReadWriteByName2(FST_CMD_READ_BY_NAME, (char *)pFileName, (UB *)pCalTxtBuf, (UW *)&filesize, 0, FST_TIME_INFINITE)==FST_STA_OK) { if(filesize >0) { debug_err(("%s",pCalTxtBuf)); for(itemNum =0 ; itemNum <= g_CalMaxItemNum; itemNum++) { if(strncmp((char *)pCalTxtBuf, g_CalItem[itemNum].pItemName,strlen(g_CalItem[itemNum].pItemName))==0) { debug_err((" %s \r\n",g_CalItem[itemNum].pItemName)); return itemNum; } } } } #endif return CAL_INVALID_DEFAULT; }
BOOL GSensor_DA380_GetStatus(Gsensor_Data *GS_Data) { short x = 0,y = 0,z = 0; static short prev_x= 0,prev_y= 0,prev_z= 0; char upd = 0, rot = 0, prev_rot = 0x0F; static UINT32 updCount = 0; INT32 xyz; int ret=FALSE; UINT32 stSens = 0; double dlSens = 0.0; ret = mir3da_read_data(&x,&y,&z); rotate(&rot,&upd,x,y,z); xyz = GSensor_DA380_GetSensitivityLevel(); //debug_msg("vincent@20150825 GSensor_DA380_GetStatus:x=%d,y=%d,z=%d\r\n", x, y, z); g_stGsenX = x; g_stGsenY = y; g_stGsenZ = z; //debug_msg("vincent@20150825 GSensor_DA380_GetStatus:g_stGsenX=%d,g_stGsenY=%d,g_stGsenZ=%d\r\n", g_stGsenX, g_stGsenY, g_stGsenZ); //vincent@20150805-1 begin #if(_MODEL_DSC_ == _MODEL_CARDV_K12_) if ((abs(x-prev_x )> LAPSE_REC_TRIG_VALUE)|| (abs(y-prev_y )> LAPSE_REC_TRIG_VALUE)|| (abs(z-prev_z )> LAPSE_REC_TRIG_VALUE)) { g_bLapseRecFlag = TRUE; } else { g_bLapseRecFlag = FALSE; } #endif //vincent@20150805-1 end if ((abs(x-prev_x )> xyz)|| (abs(y-prev_y )> xyz)|| (abs(z-prev_z )> xyz)) { debug_err((">>>> DA380 gsensor-move-----\r\n")); ret=TRUE;//return TRUE; } prev_x = x; prev_y = y; prev_z = z; return ret;//FALSE; }
INT32 SetupExe_OnWifiStart(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { UINT32 result =0; static char buf1[32]; char MacAddr[6]; LED_TurnOnLED(GPIOMAP_LED_FCS); #if (defined(__ECOS) && (_NETWORK_ == _NETWORK_SDIO_EVB_WIFI_)) #if (CARDV_ON_MEDIA_BOX_DEMO ==ENABLE) UINet_SetSSID("RTKSurveillance",strlen("RTKSurveillance")); UINet_SetAuthType(NET_AUTH_NONE); UI_SetData(FL_NetWorkMode,NETWORK_STATION_MODE); #else #if 1 // AP Mode. //UINet_SetSSID("RTKSurveillance",strlen("RTKSurveillance")); UINet_SetSSID("DAZA",strlen("DAZA")); UI_SetData(FL_NetWorkMode,NETWORK_AP_MODE); #else // Station Mode. UINet_SetSSID("MyAP",strlen("MyAP")); // SSID of AP UINet_SetAuthType(NET_AUTH_WPA2); UINet_SetPASSPHRASE("123456780",strlen("12345678")); // Password of AP UI_SetData(FL_NetWorkMode,NETWORK_STATION_MODE); #endif #endif result= UINet_WifiInit(UI_GetData(FL_NetWorkMode)); #elif(defined(__ECOS) && (_NETWORK_ == _NETWORK_SPI_EVB_ETHERNET_)) UI_SetData(FL_NetWorkMode,NETWORK_STATION_MODE); result=UINet_LanInit(UI_GetData(FL_NetWorkMode)); #endif if(result==0) { //GxLED_SetCtrl(KEYSCAN_LED_RED,SET_TOGGLE_LED,FALSE); //GxLED_SetCtrl(KEYSCAN_LED_RED,TURNON_LED,TRUE); UI_SetData(FL_WIFI_LINK,WIFI_LINK_OK); SxTimer_SetFuncActive(SX_TIMER_DET_AUTOPOWEROFF_ID,FALSE); } else { //GxLED_SetCtrl(KEYSCAN_LED_RED,SETLED_SPEED,GXLED_1SEC_LED_TOGGLE_CNT/10); //GxLED_SetCtrl(KEYSCAN_LED_RED,SET_TOGGLE_LED,TRUE); //GxLED_SetCtrl(KEYSCAN_LED_RED,TURNON_LED,TRUE); UI_SetData(FL_WIFI_LINK,WIFI_LINK_NG); } debug_err(("BackgroundWiFiOn %d result %d\r\n",UI_GetData(FL_NetWorkMode),result)); return NVTEVT_CONSUME; }
static ER DbgSys_MsgReceive(CHAR* pMsg) { UINT32 nCnt; CHAR* pDst; CHAR* pSrc = pMsg; tMSDCVENDOR_CTRL* pCtrl = MsdcVendorNvt_GetCtrl(); tMSDCVENDOR_HOST_INFO* pHost = &pCtrl->tHostInfo; tMSDCVENDOR_DBGSYS_CTRL* pDbgSys = &pCtrl->tDbgSys; UINT32 nMaxLen = pDbgSys->PayloadSize-1; pDst = (CHAR*)pDbgSys->Queue[pDbgSys->iMsgIn].pMsg; nCnt = 0; while((*pMsg)!=0 && nMaxLen--) { *(pDst++) = *(pMsg++); nCnt++; } *pDst = 0; nCnt++; DbgSys_Lock(); pDbgSys->Queue[pDbgSys->iMsgIn].nUsedBytes = nCnt; pDbgSys->iMsgIn = (pDbgSys->iMsgIn+1)&pDbgSys->MsgCntMask; DbgSys_UnLock(); if(!pDbgSys->bNoOutputUart) uart_putString(pSrc); //Check Next Payload is Empty nCnt = pDbgSys->Queue[pDbgSys->iMsgIn].nUsedBytes; if(pDbgSys->iMsgIn==pDbgSys->iMsgOut && nCnt!=0) { INT32 nRetry = 200; //Retry 2 sec for Crash Detect //Wait to Free Payload by PC Getting while(pDbgSys->iMsgIn==pDbgSys->iMsgOut && nRetry--) TimerDelayMs(10); if(nRetry<0) { DbgSys_Close((tDBGSYS_RESPONSE*)pHost->pPoolMem); debug_err(("^RDbgSys_MsgReceive Closed, due to buffer not empty,pDbgSys->iMsgIn=%d\r\n",pDbgSys->iMsgIn)); return E_OK; } } return E_OK; }
void Init_GSInfo(void) { debug_msg("[Init_MenuInfo][PStore update GSCali]\r\n"); if (bGSReady) { if (GSCaliInfo.uiVerifyCode == GSCALI_VERIFICATION) { GSSensor_ReadCalData(GSCaliInfo.GSCalData); } else { debug_err(("^R Calbration data of G Sensor is invalid, Using default value\r\n")); } } }
//Debug System Vendor Command void MsdcVendorNvt_Function_DbgSys(void) { tMSDCVENDOR_CTRL* pCtrl = MsdcVendorNvt_GetCtrl(); tMSDCVENDOR_HOST_INFO* pHost = &pCtrl->tHostInfo; UINT8 iCmd = pHost->pCBW->CBWCB[11]; void* pInfo = pHost->pPoolMem; if(!pCtrl->tDbgSys.bInit) { debug_err(("MsdcDbgSys has not been initial\r\n")); return; } if(iCmd<sizeof(CallMap)/sizeof(tMSDCVENDOR_FUNCTION_CMD_HANDLE) && iCmd == CallMap[iCmd].iCall && CallMap[iCmd].pCall!=NULL) { CallMap[iCmd].pCall(pInfo); } else { debug_err(("MsdcVendorNvt_Function_DbgSys: Call Map Wrong!\r\n")); } }
void Cal_SetImageInfor_Value(UINT32 uiRepeatCnt) { VControl *pSysCtrl = Ux_GetSysObj(); debug_err(("Cal_SetImageInfor_Value %x flash %d\r\n",uiRepeatCnt ,ImageInfoTable[uiRepeatCnt].ubFlashIndex)); Ux_SendEvent(pSysCtrl,NVTEVT_EXE_FLASH,1,ImageInfoTable[uiRepeatCnt].ubFlashIndex); Ux_SendEvent(pSysCtrl,NVTEVT_EXE_SIZE,1,ImageInfoTable[uiRepeatCnt].ubSizeIndex); Ux_SendEvent(pSysCtrl,NVTEVT_EXE_QUALITY,1,ImageInfoTable[uiRepeatCnt].ubQualityIndex); Ux_SendEvent(pSysCtrl,NVTEVT_EXE_SCENEMODE,1,ImageInfoTable[uiRepeatCnt].ubSceneIndex); Ux_SendEvent(pSysCtrl,NVTEVT_EXE_ISO,1,ImageInfoTable[uiRepeatCnt].ubISOIndex); Ux_SendEvent(pSysCtrl,NVTEVT_EXE_COLOR,1,ImageInfoTable[uiRepeatCnt].ubColorIndex); Ux_SendEvent(pSysCtrl,NVTEVT_EXE_SATURATION,1,ImageInfoTable[uiRepeatCnt].ubSaturationIndex); Ux_SendEvent(pSysCtrl,NVTEVT_EXE_SHARPNESS,1,ImageInfoTable[uiRepeatCnt].ubSharpnessIndex); }
/************************************************************************************************ 注意:接收到完整的数据后写数据库 参数1:数组指针 参数2:表类型 返回 CONTROL_RET_FAIL 发送失败, CONTROL_RET_SUC 发送成功 ************************************************************************************************/ UINT8 heat_write_date_into_sqlite(MeterFileType *pmf, char *sq_data) { char *zErrMsg = 0; int rec; char sq_dataIn[256] = { 0x00 }; heat_set_sqlite(pmf, sq_data, sq_dataIn); rec = sqlite3_exec(sqlitedb, sq_dataIn, NULL, 0, &zErrMsg); if (rec != SQLITE_OK) { debug_err(gDebugModule[METER], "[%s][%s][%d] \n", FILE_LINE); fprintf(stderr, "SQL error: %s/n", zErrMsg); sqlite3_free(zErrMsg); } return rec; }
static UINT32 cp2056_readData(void) { UINT32 i; UINT32 uiBit = 0x0800; UINT32 uiData = 0; //UINT32 uiCount = 0; gpio_clearPin(CP2056.Clk); cp2056_delay(); gpio_setPin(CP2056.Clk); cp2056_delay(); gpio_clearPin(CP2056.Clk); cp2056_delay(); #if 0 while (gpio_getPin(CP2056.Busy)) { gpio_clearPin(CP2056.Clk); cp2056_delay(); gpio_setPin(CP2056.Clk); cp2056_delay(); uiCount++; if (uiCount > 1000) { debug_err(("TP timeout!\r\n")); return 0; } }; gpio_clearPin(CP2056.Clk); cp2056_delay(); #endif for (i = 0; i < 12; i++) { gpio_setPin(CP2056.Clk); cp2056_delay(); if (gpio_getPin(CP2056.In)) uiData |= uiBit; uiBit >>= 1; gpio_clearPin(CP2056.Clk); cp2056_delay(); } return uiData; }
void Load_TPInfo(void) { PPSTORE_SECTION_HANDLE pSection; debug_msg("[Init_MenuInfo][PStore read TPCali]\r\n"); // Read TP calibration info from PStore if ((pSection = PStore_OpenSection(PS_TP_CALI, PS_RDWR)) != E_PS_SECHDLER) { PStore_ReadSection((UINT8 *)&TPCaliInfo, 0, sizeof(TPCALI_INFO), pSection); PStore_CloseSection(pSection); bTPReady = 1; } else debug_err(("^R Pstore of TouchPanel open to read FAIL\r\n")); }
void FlowMovie_StartRec(void) { //#NT#2015/01/21#KS Hung -begin //#NT#Fast boot recording. #if (_FAST_BOOT_REC_FUNC_) gMovData.State = MOV_ST_REC; #endif //#NT#2015/01/21#KS Hung -end if (g_MovRecSelfTimerSec == 0) { g_MovRecCurrTime = 0; // hide max rec time FlowMovie_IconHideMaxRecTime(); // draw rec FlowMovie_IconDrawRecTime(); gMovData.State = MOV_ST_REC; FlowMovie_UpdateIcons(TRUE); // update DCF Folder/File name FlowDCF_UpdateName(); // wait playing sound stop //#NT#2015/01/21#KS Hung -begin //#NT#Fast boot recording. #if (_FAST_BOOT_REC_FUNC_ == DISABLE) GxSound_WaitStop(); #endif //#NT#2015/01/21#KS Hung -end //#NT#2012/10/23#Philex Lin - begin // disable auto power off/USB detect timer KeyScan_EnableMisc(FALSE); //#NT#2012/10/23#Philex Lin - end GxLED_SetCtrl(KEYSCAN_LED_GREEN,TURNON_LED,FALSE); GxLED_SetCtrl(KEYSCAN_LED_GREEN,SET_TOGGLE_LED,TRUE); Ux_SendEvent(&CustomMovieObjCtrl,NVTEVT_EXE_MOVIE_REC_START,NULL); } else { debug_err(("FlowMovie_StartRec: Not yet,g_MovSelfTimerSec=%d\r\n", g_MovRecSelfTimerSec)); } }
//#NT#2009/11/02#Bowen Li -begin //#NT#modify CA function for 2 & 3 line void sie_isrCB(UINT32 IntStatus) { UINT32 HRatio, VRatio, Ratio; if (IntStatus & SIE_INT_FLDEND) { if ( ShowFPS == TRUE ) { currTime = Perf_GetCurrent(); debug_err(("%d ms\r\n", (currTime-prevTime)/1000)); prevTime = currTime; } if (Get_DZoomFlag() & DZOOM_SET_CA) { if (pre_checkFunctionEnable(PRE_CA_EN)) { Sen_GetCASubRatio(SIE_PRE_Para_prv.VGAType, GetIPPSizeInfor(_CAHSub), GetIPPSizeInfor(_CAVSub), &HRatio, &VRatio); Ratio = Sen_GetIntlvRatio(SIE_PRE_Para_prv.VGAType); SetIPPSizeInfor(_CAHsize, (GetIPPSizeInfor(_PreOutHsize) * Ratio)/HRatio); SetIPPSizeInfor(_CAVsize, (GetIPPSizeInfor(_PreOutVsize) / Ratio)/VRatio); SetIPPSizeInfor(_CALineOffset, GetIPPSizeInfor(_CAHsize)); } else { SetIPPSizeInfor(_CAHsize, GetIPPSizeInfor(_IpeOutHsize) + IPE_HSIZE_IODIFF); SetIPPSizeInfor(_CAVsize, GetIPPSizeInfor(_IpeOutVsize)); SetIPPSizeInfor(_CALineOffset, GetIPPSizeInfor(_PreOutLineOffset)); } Clr_DZoomFlag(DZOOM_SET_CA); } if (Get_DZoomFlag() & DZOOM_SET_SIEPRE) { sie_Set2Dzoom(&SIE_PRE_Para_prv); Clr_DZoomFlag(DZOOM_SET_SIEPRE); Set_DZoomFlag(DZOOM_SET_IPEIME); Set_DZoomFlag(DZOOM_SET_CA); } } if (IntStatus & SIE_INT_BP1) { if(cap_cnt>0) { cap_cnt--; } } Sen_IsrEventProc(SEN_ISR_PHOTO_SIE, IntStatus); }
void Save_GSInfo(void) { PPSTORE_SECTION_HANDLE pSection; debug_msg("[Init_MenuInfo][PStore write GSCali]\r\n"); //save data to PStore if ((pSection = PStore_OpenSection(PS_GS_CALI, PS_RDWR | PS_CREATE)) != E_PS_SECHDLER) { GSCaliInfo.uiVerifyCode= GSCALI_VERIFICATION; PStore_WriteSection((UINT8 *)&GSCaliInfo, 0, sizeof(GSCaliInfo), pSection); PStore_CloseSection(pSection); } else { debug_err(("[TPCalibrate][PStore Write GS calibration param fail]\r\n")); } }
/** motor init Init PSEUDO pin assignment @param None. @return None. */ static void motorPSEUDO_init(PLENS_DEVICE_OBJ pLensDev) { if(gPSEUDOPvtObj.bInitYet) { debug_err(("motorPSEUDO_init already\n\r")); return; } if(pLensDev->uiMotorCtrlMode == MOTOR_CTRL_SIF) { } else { } gPSEUDOPvtObj.bInitYet = TRUE; return; }
void I2C_Init() { debug_err(("<<=====================I2C_Init=======================>>\r\n")); I2C_SCL_OUT; I2C_SDA_OUT; I2C_SCL_HIGH; I2C_DELAY; I2C_SDA_HIGH; I2C_DELAY; }
void Load_GSInfo(void) { PPSTORE_SECTION_HANDLE pSection; debug_msg("[Init_MenuInfo][PStore read GSCali]\r\n"); memset((UINT8 *)&GSCaliInfo, 0, sizeof(GSCaliInfo)); if ((pSection = PStore_OpenSection(PS_GS_CALI, PS_RDWR)) != E_PS_SECHDLER) { PStore_ReadSection((UINT8 *)&GSCaliInfo, 0, sizeof(GSCaliInfo), pSection); PStore_CloseSection(pSection); bGSReady = 1; } else debug_err(("^R Pstore of G Sensor open to read FAIL\r\n")); }
static void SetSayHello(void) { UINT32 i; UINT32* pData = (UINT32*)MsdcNvt_GetDataBufferAddress(); UINT32 uiLength = MsdcNvt_GetTransSize(); debug_msg("###### Set Say Hello ###### \r\n"); if(uiLength) { for(i=0;i<uiLength;i+=4) { debug_err(("Data[%d]=%d\r\n", i, *pData)); pData++; } } }
static void DbgSys_CmdSend(void* pInfo) { tMSDCVENDOR_BACKGROUND_CTRL* pBk = &MsdcVendorNvt_GetCtrl()->tBkCtrl; tDBGSYS_CMD_SEND* pCmdSend = (tDBGSYS_CMD_SEND*)pInfo; UINT8* pCmdLine = (UINT8*)pCmdSend + sizeof(tDBGSYS_CMD_SEND); if(pCmdSend->tDeliver.biSize != sizeof(tDBGSYS_CMD_SEND)) { debug_err(("DbgSys_CmdSend(): Not Handled\r\n")); return; } pBk->nTransmitSize = CFG_MAX_COMMAND_LINE_BYTES; memcpy(pBk->pPoolMem,pCmdLine,pBk->nTransmitSize); MsdcVendorNvt_Bk_RunCmd(DbgSys_RunCmd); }
//#NT#20091127#ethanlau -end //#NT#20091207#ethanlau -begin ER ime_ChromPram(UINT32 ParamMode) { IME_FILT_PARA ime_filt_para; ime_filt_para.crv_center = IMECHROMAPARAM[GetISOIdx(0)].crv_center; ime_filt_para.crv_delta = IMECHROMAPARAM[GetISOIdx(0)].crv_delta; ime_filt_para.havg_coeff = IMECHROMAPARAM[GetISOIdx(0)].havg_coeff; ime_filt_para.havg_size = IMECHROMAPARAM[GetISOIdx(0)].havg_size; ime_filt_para.crv_en = IMECHROMAPARAM[GetISOIdx(0)].crv_en; ime_filt_para.havg_en = IMECHROMAPARAM[GetISOIdx(0)].havg_en; switch(ParamMode) { case IME_Chrom_Prv_SETTING: // ime_filt_para.crv_en = IMEALG_ENABLE; // ime_filt_para.havg_en = IMEALG_ENABLE; break; case IME_Chrom_Prv_AE_SETTING: //#NT#2011/01/18#JJ Huang -begin //#NT# For Cap IME Chroma Filter/Curve case IME_Chrom_Cap_SETTING: if(YAverage <= ChromaEnableThres) { ime_filt_para.crv_delta = ( (ChromaEnableThres - YAverage)*ime_filt_para.crv_delta + (ChromaEnableThres-1) )/ChromaEnableThres; ime_filt_para.crv_en = IMEALG_ENABLE; ime_filt_para.havg_en = IMEALG_ENABLE; } else { ime_filt_para.crv_en = IMEALG_DISABLE; ime_filt_para.havg_en = IMEALG_DISABLE; } //#NT#2011/01/18#JJ Huang -end break; default: debug_err(("ime_ChromPram() param mode selection error!\r\n")); return E_SYS; break; } ime_setChromaFilter(&ime_filt_para); return E_OK; }
/** Detect key is pressed. Detect key is pressed. Return key pressed status (refer to GPIOMapping.h) @param void @return UINT32 */ UINT32 GPIOMap_DetKey(void) { UINT32 uiKeyCode = 0; #if 0//(_GSENSOR_FUNC_ == ENABLE) if (gpio_getPin(GPIO_KEY_MODE) == 1) { if(gStarSOSDet == TRUE) { //debug_ind(("GPIOMap_DetKey: GPIO_KEY_PLAYBACK\n\r")); debug_err(("----gsensor send DISPLAY Flag---\r\n")); uiKeyCode |= FLGKEY_DISPLAY; //InterFace_KeyScan_PlaySound(KEYSCAN_SOUND_KEY_OTHERS); //Ux_PostEvent(NVTEVT_KEY_DISPLAY, 1, NVTEVT_KEY_PRESS); GSensorSensitivityReset(); } } #endif #if 0 if (gpio_getPin(GPIO_KEY_REC) == 0) { debug_ind(("GPIOMap_DetKey: GPIO_KEY_REC\n\r")); uiKeyCode |= FLGKEY_SHUTTER2; } if (gpio_getPin(GPIO_KEY_PLAYBACK) == 0) { debug_ind(("GPIOMap_DetKey: GPIO_KEY_PLAYBACK\n\r")); uiKeyCode |= FLGKEY_PLAYBACK; } if (gpio_getPin(GPIO_KEY_MODE) == 0) { debug_ind(("GPIOMap_DetKey: GPIO_KEY_MODE\n\r")); uiKeyCode |= FLGKEY_MODE; } if (gpio_getPin(GPIO_KEY_MENU) == 0) { debug_ind(("GPIOMap_DetKey: GPIO_KEY_MENU\n\r")); uiKeyCode |= FLGKEY_MENU; } #endif //uiKeyCode |= KeyADC_GetKey(); return uiKeyCode; }
void dispdev_readFromLcdMi(DISPDEV_IOCTRL pDispDevControl, UINT32 addr, UINT32 *pValue) { UINT32 High=0,Low=0; mi_setCmd1(WrCMD, (addr&0xff00)>>8); mi_setCmd2(WrCMD, addr&0x00ff); mi_setCmd3(RdDATA,0x0); mi_setCmd4(RdDATA,0x0); mi_setCmdCnt(4); mi_waitCmdDone(); // Read ID High = mi_getReadBack(3); Low = mi_getReadBack(4); *pValue =0; debug_err(("%s: Addr(0x%4X) got 0x%2X 0x%2X \r\n",__func__,addr,High,Low)); }
/** Initialize key ADC detection Initialize key ADC detection @param void @return void */ void KeyADC_Init(void) { debug_ind(("KeyADC_Init\r\n")); if (adc_open(KEY_ADC_CH_1) != E_OK) { debug_err(("Can't open ADC for key group 1\r\n")); return; } // Set sampling rate to 40KHz and sequential sampling mode // Each channel will sample once about 100 us adc_setControl(36, TRUE); // Set mode for key group 1 detection adc_setMode(KEY_ADC_CH_1, TRUE/*continuous mode*/, FALSE/*disable interrupt*/, NULL); // Enable adc control logic adc_enable(); //adc_triggerOneShot(ADC_CHANNEL_1); }
/** KNLstopTimer @param timerID @return timer ID */ void KeyScan_stopTimer(UINT32 * timerID) { if((!timerID)||((* timerID)>TIMER_NUM)) { debug_err(("^R stopTimer id error\r\n")); return ; } KeyScan_lockTimer(); _sys_timer[*timerID].counter = 0; _sys_timer[*timerID].interval = 0; _sys_timer[*timerID].eventID = NVTEVT_NULL; _sys_timer[*timerID].isEnabled = FALSE; _sys_timer[*timerID].type = ONE_SHOT; KeyScan_unlockTimer(); *timerID = NULL_TIMER; }
void caf_initial(void) { INT16 StartIdx, EndIdx, DefaultIdx; INT8 Step; RT_AF_Status = 0; Index_Cnt = 0; if (VAEnableFlag == TRUE) { caf_VAPprepare(FALSE); } caf_VAPprepare(TRUE); /* AF_GetCurrentRange(&StartIdx, &EndIdx, &Step, &DefaultIdx); StartIdx += Focus_TempComp_Far[Lens_Zoom_GetSection() - 1]; RTAF_SearchRange(StartIdx, EndIdx); */ //#NT#2010/02/22#Jarkko Chang -begin #if 1 if(g_fpGetSearchRange == NULL) { debug_err(("Get SearchRange FP is null!!\r\n")); StartIdx = Lens_Focus_GetZoomTableValue(Lens_Zoom_GetSection(), 2); EndIdx = Lens_Focus_GetZoomTableValue(Lens_Zoom_GetSection(), 0); RTAF_SearchRange(StartIdx,EndIdx); } else { g_fpGetSearchRange(); } #else if(CalLens_IsAdjust()) { RTAF_SearchRange(CalLens_GetNearFocusStep(Lens_Zoom_GetSection()), CalLens_GetFarFocusStep(Lens_Zoom_GetSection())); } else { StartIdx = Lens_Focus_GetZoomTableValue(Lens_Zoom_GetSection(), 2); EndIdx = Lens_Focus_GetZoomTableValue(Lens_Zoom_GetSection(), 0); RTAF_SearchRange(StartIdx,EndIdx); } #endif //#NT#2010/02/22#Jarkko Chang -end }
INT32 SetupExe_OnChangeDSCMode(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { UINT32 uiCurMode,uiChangeTo = 0; UINT32 uiType = DSCMODE_CHGTO_NEXT; if (paramNum>0) uiType = paramArray[0]; uiCurMode = UI_GetData(FL_NextMode); switch(uiType) { case DSCMODE_CHGTO_NEXT: if (PRIMARY_MODE_PHOTO == (INT32)uiCurMode) { uiChangeTo = PRIMARY_MODE_PLAYBACK; } else if (PRIMARY_MODE_MOVIE == (INT32)uiCurMode) { uiChangeTo = PRIMARY_MODE_PHOTO; } else if (PRIMARY_MODE_PLAYBACK == (INT32)uiCurMode) { uiChangeTo = PRIMARY_MODE_MOVIE; } else { debug_err(("UISystemObj: Unknown current DSC mode 0x%x\r\n", uiCurMode)); } break; case DSCMODE_CHGTO_PREV: uiChangeTo = UI_GetData(FL_PreMode); break; case DSCMODE_CHGTO_CURR: uiChangeTo = uiCurMode; break; } if (1)//(KeyScan_IsHDMIPlugIn()==FALSE) { UI_SetData(FL_PreMode,uiCurMode); UI_SetData(FL_NextMode,uiChangeTo); Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, uiChangeTo); } return NVTEVT_CONSUME; }