Meger code.
This commit is contained in:
		
						commit
						c8e3665f3b
					
				|  | @ -18,7 +18,7 @@ | |||
| #include <sf_param_common.h> | ||||
| #include <sf_param_struct.h> | ||||
| #include <FileSysTsk.h> | ||||
| 
 | ||||
| #include "sf_mcu.h" | ||||
| typedef struct | ||||
| { | ||||
| 	int event; | ||||
|  | @ -90,7 +90,12 @@ static UINT32 SF_StrgSpaceCheckFull(MMC_DEV_TYPE mmc_dev) | |||
| { | ||||
| 	UINT64 diskFree = 0; | ||||
|     UINT32 ret = 0; | ||||
| 
 | ||||
|     #if HUNTING_CAMERA_MCU == ENABLE | ||||
|     if(sf_get_power_off_flag() || sf_is_usb_flag()) | ||||
| 	{ | ||||
| 		return ret; | ||||
| 	} | ||||
|     #endif | ||||
|     /*check disk free size*/ | ||||
| 	if(mmc_dev == MMC_DEV_SD) | ||||
| 	{ | ||||
|  | @ -341,7 +346,7 @@ static void* mmc_monitoring_thread(void *arg) | |||
| 
 | ||||
| int sf_mmc_dev_check_start(void) | ||||
| { | ||||
| 	SF_StrgInit();// 初始化sf_mmc设备Obj
 | ||||
| 	SF_StrgInit();// 初始化sf_mmc设备Obj
 | ||||
| 
 | ||||
| 	int ret = pthread_create(&MMCMonitorTskCfg.TskId, NULL, mmc_monitoring_thread, NULL); | ||||
| 	if(ret != SF_SUCCESS) | ||||
|  |  | |||
|  | @ -15,6 +15,7 @@ | |||
| #include "UIApp/Network/UIAppWiFiCmd.h" | ||||
| #include "GxStrg.h" | ||||
| #include "GxVideoFile.h" | ||||
| #include "DCF.h" | ||||
| 
 | ||||
| #define PB_FILE_FMT             PBFMT_JPG | PBFMT_WAV | PBFMT_AVI | PBFMT_MOVMJPG | PBFMT_MP4 | PBFMT_TS | ||||
| #define RTSP_PLAY_FUNC          DISABLE | ||||
|  | @ -233,7 +234,7 @@ BOOL PBDecVideoCB(UINT32 uiUserDataAddr, UINT32 uiUserDataSize) | |||
| */ | ||||
| INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) | ||||
| { | ||||
| 	printf("[------------------------------------------------------------------------------------------------------------------]\n"); | ||||
| 
 | ||||
| 	UINT32 useFileDB = 0; | ||||
| 	UINT32 uiPoolAddr = (UINT32)mempool_filedb; | ||||
| 
 | ||||
|  | @ -260,7 +261,7 @@ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) | |||
| 	if (useFileDB) { | ||||
| 		CHAR      *rootPath = "A:\\"; | ||||
| 		//CHAR*      defaultfolder="A:\\CarDV\\";
 | ||||
| 		 printf("[---------useFileDB IN -]%d\n", useFileDB); | ||||
| 
 | ||||
| 		PPBX_FLIST_OBJ  pFlist = PBXFList_FDB_getObject(); | ||||
| 		pFlist->Config(PBX_FLIST_CONFIG_MEM, uiPoolAddr, POOL_SIZE_FILEDB); | ||||
| 		pFlist->Config(PBX_FLIST_CONFIG_MAX_FILENUM, 5000, 0); | ||||
|  | @ -275,8 +276,13 @@ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) | |||
| 		pFlist->Config(PBX_FLIST_CONFIG_SUPPORT_LONGNAME, 1, 0); | ||||
| 		PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)pFlist); | ||||
| 	} else { | ||||
| 		printf("[---------useFileDB not in -]%d\n", useFileDB); | ||||
| 		PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)PBXFList_DCF_getObject()); | ||||
| 		extern DCF_HANDLE System_Get_DCF_Handle(void); | ||||
| 
 | ||||
| 		PPBX_FLIST_OBJ  pFlist = PBXFList_DCF_getObject(); | ||||
| 		DCF_HANDLE handle = System_Get_DCF_Handle(); | ||||
| 
 | ||||
| 		pFlist->Config(PBX_FLIST_CONFIG_DCF_HANDLE, (UINT32)handle, 0); | ||||
| 		PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)pFlist); | ||||
| 	} | ||||
| 	PB_SetParam(PBPRMID_DEC_VIDEO_CALLBACK, (UINT32)PBDecVideoCB); | ||||
| 	PB_SetParam(PBPRMID_ONDRAW_CALLBACK, (UINT32)PBView_OnDrawCB); | ||||
|  |  | |||
|  | @ -15,6 +15,7 @@ | |||
| #define __DBGFLT__          "*" //*=All, [mark]=CustomClass
 | ||||
| #include <kwrap/debug.h> | ||||
| 
 | ||||
| extern DCF_HANDLE System_Get_DCF_Handle(void); | ||||
| 
 | ||||
| void CloseAutoHideTimer(void) | ||||
| { | ||||
|  | @ -61,11 +62,13 @@ void ChkKeySoundComm(void) | |||
| 
 | ||||
| 
 | ||||
| static BOOL    gbNoFile = TRUE; | ||||
| 
 | ||||
| static void xUIPlay_Filesys_DelCB(FIND_DATA *pFindData, BOOL *bDelete, UINT32 Param1, UINT32 Param2) | ||||
| { | ||||
| 	INT32    fileNum; | ||||
| 	UINT32   fileType; | ||||
| 	UINT32   filterType = (DCF_GetDBInfo(DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfo(DCF_INFO_DEP_FILE_FMT)); | ||||
| 	DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); | ||||
| 	UINT32   filterType = (DCF_GetDBInfoEx(dcf_handle, DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfoEx(dcf_handle, DCF_INFO_DEP_FILE_FMT)); | ||||
| 	UINT8     attrib; | ||||
| 
 | ||||
| 	attrib    = pFindData->attrib; | ||||
|  | @ -85,7 +88,8 @@ static void xUIPlay_Filesys_LockCB(FIND_DATA *pFindData, BOOL *bApply, UINT32 Pa | |||
| { | ||||
| 	INT32    fileNum; | ||||
| 	UINT32   fileType; | ||||
| 	UINT32   filterType = (DCF_GetDBInfo(DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfo(DCF_INFO_DEP_FILE_FMT)); | ||||
| 	DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); | ||||
| 	UINT32   filterType = (DCF_GetDBInfoEx(dcf_handle, DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfoEx(dcf_handle, DCF_INFO_DEP_FILE_FMT)); | ||||
| 
 | ||||
| 	DBG_IND("FileName = %s\r\n", pFindData->FATMainName); | ||||
| 
 | ||||
|  | @ -102,14 +106,15 @@ static void xUIPlay_FList_DCF_DelAll(void) | |||
| 	char path[DCF_FULL_FILE_PATH_LEN]; | ||||
| 	BOOL ret; | ||||
| 	UINT32 i, uiMaxDirNum; | ||||
| 	DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); | ||||
| 
 | ||||
| 	uiMaxDirNum = DCF_GetDBInfo(DCF_INFO_MAX_DIR_ID); | ||||
| 	uiMaxDirNum = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_MAX_DIR_ID); | ||||
| 	for (i = 100; i <= uiMaxDirNum; i++) { | ||||
| 		// check if folder has file
 | ||||
| 		ret = DCF_GetDirInfo(i, &dirinfo); | ||||
| 		ret = DCF_GetDirInfoEx(dcf_handle, i, &dirinfo); | ||||
| 		if (ret /*&& dirinfo.uiNumOfDcfObj*/) { | ||||
| 			// delete all in one folder
 | ||||
| 			DCF_GetDirPath(i, path); | ||||
| 			DCF_GetDirPathEx(dcf_handle, i, path); | ||||
| 			gbNoFile = TRUE; | ||||
| 			FileSys_DelDirFiles(path, xUIPlay_Filesys_DelCB); | ||||
| 			// delete empty folder
 | ||||
|  | @ -120,7 +125,7 @@ static void xUIPlay_FList_DCF_DelAll(void) | |||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	DCF_Refresh(); | ||||
| 	DCF_RefreshEx(dcf_handle); | ||||
| } | ||||
| static ER xUIPlay_FList_FDB_ProtectFile(UINT32  cmdID) | ||||
| { | ||||
|  | @ -191,13 +196,14 @@ static void xUIPlay_FList_DCF_LockAll(BOOL bLock) | |||
| 	SDCFDIRINFO dirinfo = {0}; | ||||
| 	char path[DCF_FULL_FILE_PATH_LEN] = {0}; | ||||
| 	UINT32 i, uiMaxDirNum; | ||||
| 	DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); | ||||
| 
 | ||||
| 	uiMaxDirNum = DCF_GetDBInfo(DCF_INFO_MAX_DIR_ID); | ||||
| 	uiMaxDirNum = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_MAX_DIR_ID); | ||||
| 	for (i = 100; i <= uiMaxDirNum; i++) { | ||||
| 		// check if folder has file
 | ||||
| 		if (DCF_GetDirInfo(i, &dirinfo)) { | ||||
| 		if (DCF_GetDirInfoEx(dcf_handle, i, &dirinfo)) { | ||||
| 			if (dirinfo.uiNumOfDcfObj) { | ||||
| 				DCF_GetDirPath(i, path); | ||||
| 				DCF_GetDirPathEx(dcf_handle, i, path); | ||||
| 				FileSys_LockDirFiles(path, bLock, xUIPlay_Filesys_LockCB); | ||||
| 			} | ||||
| 		} | ||||
|  | @ -209,6 +215,7 @@ static ER xUIPlay_FList_DCF_ProtectFile(UINT32  cmdID) | |||
| 	char     filePath[DCF_FULL_FILE_PATH_LEN]; | ||||
| 	UINT32   index, i, uiThisFileFormat, tmpFileType; | ||||
| 	BOOL     bLock; | ||||
| 	DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); | ||||
| 
 | ||||
| 	DBG_IND("cmdID=%d\r\n", cmdID); | ||||
| 	if ((cmdID == PLAY_PROTECT_ONE) || (cmdID == PLAY_UNPROTECT_ONE)) { | ||||
|  | @ -217,13 +224,13 @@ static ER xUIPlay_FList_DCF_ProtectFile(UINT32  cmdID) | |||
| 		} else { | ||||
| 			bLock = FALSE;    // unlock
 | ||||
| 		} | ||||
| 		index = DCF_GetCurIndex(); | ||||
| 		uiThisFileFormat = DCF_GetDBInfo(DCF_INFO_CUR_FILE_TYPE); | ||||
| 		index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX); | ||||
| 		uiThisFileFormat = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_FILE_TYPE); | ||||
| 		for (i = 0; i <= DCF_FILE_TYPE_NUM; i++) { | ||||
| 			tmpFileType = 1; | ||||
| 			tmpFileType <<= i; | ||||
| 			if (uiThisFileFormat & tmpFileType) { | ||||
| 				DCF_GetObjPath(index, tmpFileType, filePath); | ||||
| 				DCF_GetObjPathEx(dcf_handle, index, tmpFileType, filePath); | ||||
| 				FileSys_SetAttrib(filePath, FST_ATTRIB_READONLY, bLock); | ||||
| 			} | ||||
| 		} | ||||
|  | @ -361,6 +368,9 @@ static ER xUIPlay_FList_FDB_DelFile(UINT32  cmdID) | |||
| static ER xUIPlay_FList_DCF_DelFile(UINT32  cmdID) | ||||
| { | ||||
| 	DBG_IND("cmdID=%d\r\n", cmdID); | ||||
| 
 | ||||
| 	DCF_HANDLE dcf_handle = System_Get_DCF_Handle(); | ||||
| 
 | ||||
| 	if (cmdID == PB_DELETE_ONE) { | ||||
| 		//#NT#2016/05/24#Ben Wang -begin
 | ||||
| 		//#NT#Fix the coverity issue.
 | ||||
|  | @ -368,14 +378,14 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32  cmdID) | |||
| 		//#NT#2016/05/24#Ben Wang -end
 | ||||
| 		CHAR   filePath[DCF_FULL_FILE_PATH_LEN] = {0}; | ||||
| 
 | ||||
| 		index = DCF_GetCurIndex(); | ||||
| 		uiThisFileFormat = DCF_GetDBInfo(DCF_INFO_CUR_FILE_TYPE); | ||||
| 		index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX); | ||||
| 		uiThisFileFormat = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_FILE_TYPE); | ||||
| 		for (i = 0; i <= DCF_FILE_TYPE_NUM; i++) { | ||||
| 			tmpFileType = 0x0001 << i; | ||||
| 			if (uiThisFileFormat & tmpFileType) { | ||||
| 				if (DCF_GetObjPath(index, uiThisFileFormat, filePath)) { | ||||
| 				if (DCF_GetObjPathEx(dcf_handle, index, uiThisFileFormat, filePath)) { | ||||
| 					if (FST_STA_OK == FileSys_DeleteFile(filePath)) { | ||||
| 						DCF_DelDBfile(filePath); | ||||
| 						DCF_DelDBfileEx(dcf_handle, filePath); | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
|  | @ -387,9 +397,9 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32  cmdID) | |||
| 		UINT32      DirID = 0, FileID = 0, Index = 0, uiThisFileFormat = 0; | ||||
| 		BOOL        isCurrFileReadOnly = FALSE; | ||||
| 
 | ||||
| 		Index = DCF_GetDBInfo(DCF_INFO_CUR_INDEX); | ||||
| 		DCF_GetObjInfo(Index, &DirID, &FileID, &uiThisFileFormat); | ||||
| 		DCF_GetObjPath(Index, uiThisFileFormat, filePath); | ||||
| 		Index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX); | ||||
| 		DCF_GetObjInfoEx(dcf_handle, Index, &DirID, &FileID, &uiThisFileFormat); | ||||
| 		DCF_GetObjPathEx(dcf_handle, Index, uiThisFileFormat, filePath); | ||||
| 
 | ||||
| 		ret = FileSys_GetAttrib(filePath, &attrib); | ||||
| 		if ((ret == E_OK) && M_IsReadOnly(attrib) == TRUE) { | ||||
|  | @ -399,10 +409,10 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32  cmdID) | |||
| 		// ---------  delete all files  -----------------------
 | ||||
| 		xUIPlay_FList_DCF_DelAll(); | ||||
| 		if (isCurrFileReadOnly) { | ||||
| 			Index = DCF_GetIndexByID(DirID, FileID); | ||||
| 			DCF_SetCurIndex(Index); | ||||
| 			Index = DCF_GetIndexByIDEx(dcf_handle, DirID, FileID); | ||||
| 			DCF_SetCurIndexEx(dcf_handle, Index); | ||||
| 		} | ||||
| 		DCF_Refresh(); | ||||
| 		DCF_RefreshEx(dcf_handle); | ||||
| 	} | ||||
| 	return E_OK; | ||||
| } | ||||
|  |  | |||
|  | @ -773,8 +773,14 @@ static void update_sd_card_status(lv_obj_t* obj) | |||
| 			LV_PLUGIN_IMG_ID_SF_SD_256GB, | ||||
| 			LV_PLUGIN_IMG_ID_SF_SD_FULL | ||||
| 	}; | ||||
| 	UINT64 diskSize =  FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE); | ||||
| 	unsigned int index = check_sd_size(diskSize); | ||||
| 	UINT64 diskSize =  0; | ||||
| 	unsigned int index = 0; | ||||
|     UINT32 cardStatus = System_GetState(SYS_STATE_CARD); | ||||
|     if (cardStatus != CARD_REMOVED) | ||||
|     { | ||||
|         diskSize =  FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE); | ||||
| 	    index = check_sd_size(diskSize); | ||||
|     } | ||||
| 	if (index > 7) | ||||
| 	{ | ||||
| 		return; | ||||
|  | @ -946,6 +952,12 @@ static void update_dzoom(void) | |||
| static void update_icons(void) | ||||
| { | ||||
| 	// printf(" update_icons\n ");
 | ||||
|     #if HUNTING_CAMERA_MCU == ENABLE | ||||
|     if(sf_get_power_off_flag() || sf_is_usb_flag()) | ||||
| 	{ | ||||
| 		return; | ||||
| 	} | ||||
|     #endif | ||||
| 	update_selftimer(); | ||||
| 	update_size(); | ||||
| 	update_quality(); | ||||
|  |  | |||
|  | @ -58,8 +58,8 @@ static void task_msgbox_timer_cb(lv_task_t* task) | |||
| 			{ | ||||
| 				sf_set_pir_statu_flag(1); | ||||
| 				// OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF);
 | ||||
| 				#define DO_NOT_SHOW_POWER_OFF 0 | ||||
|         		Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); | ||||
| 				//#define DO_NOT_SHOW_POWER_OFF 0
 | ||||
|         		//Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF);
 | ||||
| 			} | ||||
| 			return; | ||||
| 		} | ||||
|  |  | |||
|  | @ -895,7 +895,19 @@ void sf_battery_level_polling(void) | |||
|                 LibatCnt++; | ||||
|             } | ||||
| 			readBatCnt++; | ||||
|             if(puiPara->BatteryLogSwitch) | ||||
|             { | ||||
|                 printf("\nDC Adc:%d After Convert:(%d.%dV),Is Dc In=%s, TemperAdc:%d \n", sf_battery_convert_to_adc(24, 100, DcVoltageVal), DcVoltageVal / 10, DcVoltageVal % 10, IsPowerDcIn == 1? "Yes" : "No", TemperAdc); | ||||
| 
 | ||||
|                 if(LiPolymerVoltageVal) | ||||
|                 { | ||||
|                     printf("Li Battery Adc:%d After Convert:(%d.%dV)\n\n", sf_battery_convert_to_adc(24, 100, LiPolymerVoltageVal), LiPolymerVoltageVal / 10, LiPolymerVoltageVal % 10); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     printf("Other Battery Adc:%d After Convert:(%d.%dV)\n\n", sf_aa_battery_convert_to_adc(24, 100, BatVoltageVal),BatVoltageVal / 10, BatVoltageVal % 10); | ||||
|                 } | ||||
|             } | ||||
| 			if(readBatCnt >= 10) | ||||
| 			{ | ||||
|                 _DcVoltageVal = dcTemp / 10; | ||||
|  |  | |||
|  | @ -78,6 +78,7 @@ typedef enum _PBX_FLIST_CONFIG_ID { | |||
| 	PBX_FLIST_CONFIG_SORT_BYSN_DELIMSTR         = 0x10,	   ///< only for FileDB, set the delimiter string, e.g. underline "_", "AA"
 | ||||
| 	PBX_FLIST_CONFIG_SORT_BYSN_DELIMNUM         = 0x11,    ///< only for FileDB, set the delimiter count to find the serial number
 | ||||
| 	PBX_FLIST_CONFIG_SORT_BYSN_NUMOFSN          = 0x12,	   ///< only for FileDB, set the character number of the serial number
 | ||||
| 	PBX_FLIST_CONFIG_DCF_HANDLE                 = 0x13,    ///< only for DCF , multi storage DCF handle
 | ||||
| 	ENUM_DUMMY4WORD(PBX_FLIST_CONFIG_ID) | ||||
| } PBX_FLIST_CONFIG_ID; | ||||
| 
 | ||||
|  |  | |||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							|  | @ -290,7 +290,7 @@ void sf_mode_detect(void) | |||
|             else if(pwroffcnt == 6) | ||||
|             { | ||||
|                 sf_sys_status_led_set(SF_LED_SYS_STATE_POWER_OFF); | ||||
|                 /*
 | ||||
|                  | ||||
|                 printf("[power off] %s(%d) AutoOfftime:%d\n", __FUNCTION__, __LINE__, AutoOfftime); | ||||
|                 #define DO_NOT_SHOW_POWER_OFF 0 | ||||
|                 if(AutoOfftime >= KeepAliveTime_s) | ||||
|  | @ -305,7 +305,7 @@ void sf_mode_detect(void) | |||
|                     Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); //shutdown start
 | ||||
|                     #endif | ||||
|                 } | ||||
|                 sf_set_power_off_flag(1);*/ | ||||
|                 sf_set_power_off_flag(1); | ||||
|             } | ||||
|         } | ||||
|         else | ||||
|  |  | |||
|  | @ -2171,7 +2171,6 @@ void sf_file_thumb_cfg_sava(void) | |||
| 	UINT8 fileIndex = 0; | ||||
|     INT32 ret_fs = 0; | ||||
|     FST_FILE_STATUS FileStat; | ||||
|     char tmp[64] = {'\0'}; | ||||
|     UIMenuStoreInfo *puiPara = sf_ui_para_get(); | ||||
| 
 | ||||
| 	if (pThumbFileCfg != NULL) { | ||||
|  | @ -2183,6 +2182,7 @@ void sf_file_thumb_cfg_sava(void) | |||
|         //static int flag = 0;
 | ||||
|         //struct stat st;
 | ||||
|         #if SF_IQ_TEST != ENABLE | ||||
|         char tmp[64] = {'\0'}; | ||||
|         INT32 uiStatus = 0; | ||||
|         UINT8  ucAttrib = 0; | ||||
|         snprintf(tmp, sizeof(tmp), "%c%s", 'A', PHOTO_THUMB_PATH); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 xiaojiazhu
						xiaojiazhu