加宏控制RTOS和Linux下mmc_dev_check逻辑,默认check逻辑关闭
This commit is contained in:
		
							parent
							
								
									56b590d983
								
							
						
					
					
						commit
						e6dde55948
					
				| 
						 | 
				
			
			@ -63,6 +63,7 @@ void SF_StrgInit(void)
 | 
			
		|||
        sf_mmc_dev[i]->space_state       = MMC_DEV_SPACE_STATE_ENOUGH;
 | 
			
		||||
        sf_mmc_dev[i]->loop_state        = MMC_DEV_LOOP_STATE_OFF;
 | 
			
		||||
    }
 | 
			
		||||
	pMMCDev = (SF_ST_MMC_DEV *)malloc(sizeof(SF_ST_MMC_DEV));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SF_StrgUnInit(void)
 | 
			
		||||
| 
						 | 
				
			
			@ -74,6 +75,8 @@ void SF_StrgUnInit(void)
 | 
			
		|||
            sf_mmc_dev[i] = NULL;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
	free(pMMCDev);
 | 
			
		||||
	pMMCDev = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SF_StrgSetDcfHandle(UINT32 strg_id, UINT32 handle)
 | 
			
		||||
| 
						 | 
				
			
			@ -86,7 +89,6 @@ static UINT32 SF_StrgSpaceCheckFull(MMC_DEV_TYPE mmc_dev)
 | 
			
		|||
	UINT64 diskFree = 0;
 | 
			
		||||
    UINT32 ret = 0;
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
    /*check disk free size*/
 | 
			
		||||
	if(mmc_dev == MMC_DEV_SD)
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			@ -313,10 +315,12 @@ SF_ST_MMC_DEV *SF_StrgCheckWorkableDev(void)
 | 
			
		|||
 | 
			
		||||
	if(workable_dev == MMC_DEV_NO)
 | 
			
		||||
	{
 | 
			
		||||
		MLOGD("Strg Check, No dev can use\n");
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		MLOGD("Strg Check, workable_dev = %d\n", workable_dev);
 | 
			
		||||
		return sf_mmc_dev[workable_dev];
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -326,9 +330,9 @@ static void* mmc_monitoring_thread(void *arg)
 | 
			
		|||
	while(MMCMonitorTskCfg.IsRun)
 | 
			
		||||
	{
 | 
			
		||||
#if USE_MMC_DEV_CHECK
 | 
			
		||||
		SF_SetMMCDev(SF_StrgCheckWorkableDev());
 | 
			
		||||
		pMMCDev = SF_StrgCheckWorkableDev();
 | 
			
		||||
#endif
 | 
			
		||||
		sf_sleep_ms(500);
 | 
			
		||||
		sf_sleep_ms(1000);
 | 
			
		||||
	}
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -341,6 +345,8 @@ int sf_mmc_dev_check_start(void)
 | 
			
		|||
		MLOGD("thread sf_mmc_monitoring_start creat fail!\n");
 | 
			
		||||
		return ret;
 | 
			
		||||
	}
 | 
			
		||||
	MMCMonitorTskCfg.IsRun = 1;
 | 
			
		||||
	MLOGD("mmc_dev check create success!\n");
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,7 @@
 | 
			
		|||
#define EMMC_DEVICE_NAME                          "/dev/mmcblk1p1"
 | 
			
		||||
#define EMMC_MOUNT_ROOT                           "/mnt/sd2"
 | 
			
		||||
 | 
			
		||||
#define USE_MMC_DEV_CHECK	(1)
 | 
			
		||||
#define USE_MMC_DEV_CHECK	(0)
 | 
			
		||||
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -447,7 +447,9 @@ int NvtMain(void)
 | 
			
		|||
        printf("create cardv message successs!!!!\n");
 | 
			
		||||
    }
 | 
			
		||||
    sf_cardv_message_thread_init();
 | 
			
		||||
    
 | 
			
		||||
#if USE_MMC_DEV_CHECK
 | 
			
		||||
	sf_mmc_dev_check_start();
 | 
			
		||||
#endif    
 | 
			
		||||
    SF_MESSAGE_BUF_S stMessageBuf = {0};
 | 
			
		||||
 | 
			
		||||
    /*if(!sf_gpio_get_status(GPIO_KEY_TEST)){
 | 
			
		||||
| 
						 | 
				
			
			@ -476,8 +478,6 @@ int NvtMain(void)
 | 
			
		|||
    sf_led_init();
 | 
			
		||||
    #endif
 | 
			
		||||
    sf_sd_exist_reg_cb(DrvCARD_DetStrgCard);
 | 
			
		||||
 | 
			
		||||
	sf_mmc_dev_check_start();
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	System_WaitForPowerOffStart();  // Wait for shutdown cmd
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,9 +38,10 @@
 | 
			
		|||
#define __DBGFLT__          "*" //*=All, [mark]=CustomClass
 | 
			
		||||
#include <kwrap/debug.h>
 | 
			
		||||
#include "SF_SysStrgMng.h"
 | 
			
		||||
#if USE_MMC_DEV_CHECK
 | 
			
		||||
 | 
			
		||||
SF_ST_MMC_DEV *mmc_dev = NULL;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
void UIStorageCheck_AllSize(UINT64 *uiTotal, UINT64 *uiRemain)
 | 
			
		||||
{
 | 
			
		||||
	(*uiTotal) = FileSys_GetDiskInfo(FST_INFO_DISK_SIZE);
 | 
			
		||||
| 
						 | 
				
			
			@ -257,9 +258,11 @@ BOOL UIStorageCheck(UINT32 uiCheckItem, UINT32 *pFreeCount)
 | 
			
		|||
	UINT32 useFileDB = 0;
 | 
			
		||||
	useFileDB = UI_GetData(FL_IsUseFileDB);
 | 
			
		||||
 | 
			
		||||
	mmc_dev = SF_GetMMCDev();
 | 
			
		||||
	
 | 
			
		||||
	DBG_IND("UI_StorageCheck: Check item = 0x%x\r\n", uiCheckItem);
 | 
			
		||||
#if USE_MMC_DEV_CHECK
 | 
			
		||||
	mmc_dev = SF_GetMMCDev();
 | 
			
		||||
 | 
			
		||||
	if(mmc_dev == NULL)
 | 
			
		||||
	{
 | 
			
		||||
		DBG_ERR("No MMC_Dev Can use!\n");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -63,8 +63,9 @@ static void card_insert_job(void)
 | 
			
		|||
	// call the function to wait init finish
 | 
			
		||||
	FileSys_WaitFinishEx('A');
 | 
			
		||||
    FileSys_SetParamEx('A', FST_PARM_UPDATE_FSINFO , TRUE);
 | 
			
		||||
 | 
			
		||||
#if USE_RTOS_MMC_CHECK
 | 
			
		||||
	SF_RtosStrgRegister(0, ret);
 | 
			
		||||
#endif
 | 
			
		||||
#if HUNTING_CAMERA_MCU == ENABLE
 | 
			
		||||
    if(TRUE == sf_check_card_full())
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -122,7 +123,9 @@ static void card_insert_job2(void)
 | 
			
		|||
 | 
			
		||||
	FileSys_WaitFinishEx('B');
 | 
			
		||||
    FileSys_SetParamEx('B', FST_PARM_UPDATE_FSINFO , TRUE);
 | 
			
		||||
#if USE_RTOS_MMC_CHECK
 | 
			
		||||
	SF_RtosStrgRegister(1, ret);
 | 
			
		||||
#endif
 | 
			
		||||
	fastboot_set_done(BOOT_INIT_FILESYSOK_2);
 | 
			
		||||
	printf("filesys2_init e\r\n");
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -143,7 +146,9 @@ static void sys_detect_card_task(void)
 | 
			
		|||
#if defined(_EMBMEM_EMMC_)
 | 
			
		||||
	THREAD_ENTRY();
 | 
			
		||||
 | 
			
		||||
#if USE_RTOS_MMC_CHECK
 | 
			
		||||
	SF_RtosStrgInit();
 | 
			
		||||
#endif
 | 
			
		||||
	card_insert_job();
 | 
			
		||||
 | 
			
		||||
	THREAD_RETURN(0);
 | 
			
		||||
| 
						 | 
				
			
			@ -176,7 +181,9 @@ static void sys_detect_card_task(void)
 | 
			
		|||
 | 
			
		||||
		vTaskDelay(pdMS_TO_TICKS(1000));
 | 
			
		||||
	}
 | 
			
		||||
#if USE_RTOS_MMC_CHECK
 | 
			
		||||
	SF_RtosStrgUnInit();
 | 
			
		||||
#endif
 | 
			
		||||
	THREAD_RETURN(0);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1172,6 +1172,7 @@ static void MovieFast_UserEventCb(UINT32 id, MOVIE_USER_CB_EVENT event_id, UINT3
 | 
			
		|||
					char tmp[256] = {'\0'};
 | 
			
		||||
 | 
			
		||||
                    #if HUNTING_CAMERA_MCU == ENABLE
 | 
			
		||||
#if USE_RTOS_MMC_CHECK					
 | 
			
		||||
					SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev();
 | 
			
		||||
					if(mmc_dev->dcf_handle < 0)
 | 
			
		||||
					{
 | 
			
		||||
| 
						 | 
				
			
			@ -1188,7 +1189,9 @@ static void MovieFast_UserEventCb(UINT32 id, MOVIE_USER_CB_EVENT event_id, UINT3
 | 
			
		|||
							snprintf(tmp, sizeof(tmp), "%c%s%s", 'B', MOVIE_THUMB_PATH, thumb_current_path); /* DCF 8.3 naming rule */
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					
 | 
			
		||||
#else
 | 
			
		||||
					snprintf(tmp, sizeof(tmp), "%c%s%s", 'A', MOVIE_THUMB_PATH, thumb_current_path); /* DCF 8.3 naming rule */
 | 
			
		||||
#endif
 | 
			
		||||
                    #else
 | 
			
		||||
					snprintf(tmp, sizeof(tmp), "%s%s", MOVIE_THUMB_PATH, (thumb_current_path + (length - 12))); /* DCF 8.3 naming rule */
 | 
			
		||||
					snprintf(tmp + strlen(tmp) - 3, sizeof(tmp), "%s", "JPG");
 | 
			
		||||
| 
						 | 
				
			
			@ -1301,7 +1304,9 @@ THREAD_RETTYPE MovieFast_InitFileNamingThread(void *arg)
 | 
			
		|||
        if(TRUE != sf_is_card_full())
 | 
			
		||||
        #endif
 | 
			
		||||
        {
 | 
			
		||||
			SF_RtosStrgSetDcfHandle(MMC_DEV_EMMC, g_dcf_hdl2);
 | 
			
		||||
#if USE_RTOS_MMC_CHECK
 | 
			
		||||
			SF_RtosStrgSetDcfHandle(MMC_DEV_EMMC, g_dcf_hdl);
 | 
			
		||||
#endif
 | 
			
		||||
            fastboot_set_done(BOOT_INIT_FILENAMINGOK);
 | 
			
		||||
        }
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -1342,7 +1347,9 @@ THREAD_RETTYPE MovieFast_InitFileNamingThread2(void *arg)
 | 
			
		|||
        if(TRUE != sf_is_card_full())
 | 
			
		||||
        #endif
 | 
			
		||||
        {
 | 
			
		||||
			SF_RtosStrgSetDcfHandle(MMC_DEV_SD,  g_dcf_hdl);
 | 
			
		||||
#if USE_RTOS_MMC_CHECK
 | 
			
		||||
			SF_RtosStrgSetDcfHandle(MMC_DEV_SD,  g_dcf_hdl2);
 | 
			
		||||
#endif
 | 
			
		||||
			fastboot_set_done(BOOT_INIT_FILENAMINGOK_2);
 | 
			
		||||
        }
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -623,17 +623,21 @@ UINT32 PhotoExe_GetFreePicNum(void)
 | 
			
		|||
	UINT32              reserveSize = 0x80000; //  500KB
 | 
			
		||||
	UINT32              CaptureSize;
 | 
			
		||||
	UINT32              size;
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
	SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev();
 | 
			
		||||
	if(mmc_dev->dcf_handle < 0)
 | 
			
		||||
	{
 | 
			
		||||
		DBG_ERR("No MMC_Dev Can use!\n");
 | 
			
		||||
		return FALSE;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if (FILESIZE_ALIGN_FUNC)
 | 
			
		||||
	reserveSize += FS_ALIGN_RESERVED_SIZE;
 | 
			
		||||
#endif
 | 
			
		||||
#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
 | 
			
		||||
	if(mmc_dev->dev_type == MMC_DEV_SD)
 | 
			
		||||
	{
 | 
			
		||||
		uiFreeSpace = FileSys_GetDiskInfoEx('A', FST_INFO_FREE_SPACE);
 | 
			
		||||
| 
						 | 
				
			
			@ -642,7 +646,9 @@ UINT32 PhotoExe_GetFreePicNum(void)
 | 
			
		|||
	{
 | 
			
		||||
		uiFreeSpace = FileSys_GetDiskInfoEx('B', FST_INFO_FREE_SPACE);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
	uiFreeSpace = FileSys_GetDiskInfoEx('A', FST_INFO_FREE_SPACE);
 | 
			
		||||
#endif
 | 
			
		||||
	DBG_IND("[cap]Free Space = %d KB\r\n", uiFreeSpace / 1024);
 | 
			
		||||
 | 
			
		||||
	size = UI_GetData(FL_PHOTO_SIZE);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,12 +58,15 @@ void UIStorageCheck_ResetFileReachMax(void)
 | 
			
		|||
 | 
			
		||||
static BOOL check_CurrDir_writable(void)
 | 
			
		||||
{
 | 
			
		||||
#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
 | 
			
		||||
	SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev();
 | 
			
		||||
	if(mmc_dev->dcf_handle < 0)
 | 
			
		||||
	{
 | 
			
		||||
		DBG_ERR("No MMC_Dev Can use!\n");
 | 
			
		||||
		return FALSE;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
	UINT32 useFileDB = 0;
 | 
			
		||||
	useFileDB = UI_GetData(FL_IsUseFileDB);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -73,10 +76,15 @@ static BOOL check_CurrDir_writable(void)
 | 
			
		|||
#if (USE_DCF == ENABLE)
 | 
			
		||||
		UINT32 CurrDirID;
 | 
			
		||||
		SDCFDIRINFO dirinfo = {0};
 | 
			
		||||
 | 
			
		||||
#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
		CurrDirID = DCF_GetDBInfoEx(mmc_dev->dcf_handle, DCF_INFO_CUR_DIR_ID);
 | 
			
		||||
		if (CurrDirID) {
 | 
			
		||||
			if (DCF_GetDirInfoEx(mmc_dev->dcf_handle, CurrDirID, &dirinfo)) {
 | 
			
		||||
#else
 | 
			
		||||
		CurrDirID = DCF_GetDBInfo(DCF_INFO_CUR_DIR_ID);
 | 
			
		||||
		if (CurrDirID) {
 | 
			
		||||
			if (DCF_GetDirInfo(CurrDirID, &dirinfo)) {
 | 
			
		||||
#endif
 | 
			
		||||
				if (M_IsReadOnly(dirinfo.ucAttrib)) {
 | 
			
		||||
					DBG_IND("DCF folder %d is READONLY.\r\n", CurrDirID);
 | 
			
		||||
					return FALSE;
 | 
			
		||||
| 
						 | 
				
			
			@ -100,13 +108,15 @@ static BOOL check_CurrDir_writable(void)
 | 
			
		|||
 | 
			
		||||
BOOL UIStorageCheck_DCIMWritable(void)
 | 
			
		||||
{
 | 
			
		||||
#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
 | 
			
		||||
	SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev();
 | 
			
		||||
	if(mmc_dev->dcf_handle < 0)
 | 
			
		||||
	{
 | 
			
		||||
		DBG_ERR("No MMC_Dev Can use!\n");
 | 
			
		||||
		return FALSE;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
#endif	
 | 
			
		||||
	UINT32 useFileDB = 0;
 | 
			
		||||
	useFileDB = UI_GetData(FL_IsUseFileDB);
 | 
			
		||||
	if (useFileDB) {
 | 
			
		||||
| 
						 | 
				
			
			@ -115,6 +125,7 @@ BOOL UIStorageCheck_DCIMWritable(void)
 | 
			
		|||
		INT32 uiStatus = 0;
 | 
			
		||||
		UINT8  ucAttrib = 0;
 | 
			
		||||
		BOOL   ret = FALSE;
 | 
			
		||||
		#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
		if(mmc_dev->dev_type == MMC_DEV_SD)
 | 
			
		||||
		{
 | 
			
		||||
			uiStatus = FileSys_GetAttrib("A:\\DCIM", &ucAttrib);
 | 
			
		||||
| 
						 | 
				
			
			@ -123,6 +134,9 @@ BOOL UIStorageCheck_DCIMWritable(void)
 | 
			
		|||
		{
 | 
			
		||||
			uiStatus = FileSys_GetAttrib("B:\\DCIM", &ucAttrib);
 | 
			
		||||
		}
 | 
			
		||||
		#else
 | 
			
		||||
			uiStatus = FileSys_GetAttrib("A:\\DCIM", &ucAttrib);
 | 
			
		||||
		#endif
 | 
			
		||||
 | 
			
		||||
		if (uiStatus == FST_STA_OK) {
 | 
			
		||||
			if (ucAttrib & FS_ATTRIB_DIRECTORY) {
 | 
			
		||||
| 
						 | 
				
			
			@ -161,8 +175,11 @@ static BOOL UIStrgCheckFolderFull(DCF_HANDLE DcfHandle)
 | 
			
		|||
		return TRUE;
 | 
			
		||||
	}
 | 
			
		||||
	bIsFileReachMax = FALSE;
 | 
			
		||||
 | 
			
		||||
#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
	ret = DCF_GetNextIDEx(DcfHandle, &DCF_DirId, &DCF_FileId);
 | 
			
		||||
#else
 | 
			
		||||
	ret = DCF_GetNextID(&DCF_DirId, &DCF_FileId);
 | 
			
		||||
#endif
 | 
			
		||||
	if (ret && DCF_DirId == 0 && DCF_FileId == 0) {
 | 
			
		||||
		bIsFileReachMax = TRUE;
 | 
			
		||||
		DBG_IND("Next dir_id   =%d,   file_id = %d \r\n", DCF_DirId, DCF_FileId);
 | 
			
		||||
| 
						 | 
				
			
			@ -199,6 +216,8 @@ static BOOL UIStrgCheckFull(UINT32 *pFreeCount)
 | 
			
		|||
 | 
			
		||||
static BOOL UIStrgCheckErr(MMC_DEV_TYPE dev_id)
 | 
			
		||||
{
 | 
			
		||||
#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
 | 
			
		||||
	if(dev_id == MMC_DEV_SD)
 | 
			
		||||
	{
 | 
			
		||||
		FileSys_WaitFinishEx('A');
 | 
			
		||||
| 
						 | 
				
			
			@ -207,7 +226,9 @@ static BOOL UIStrgCheckErr(MMC_DEV_TYPE dev_id)
 | 
			
		|||
	{
 | 
			
		||||
		FileSys_WaitFinishEx('B');
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
#else
 | 
			
		||||
	FileSys_WaitFinishEx('A');
 | 
			
		||||
#endif
 | 
			
		||||
	if (System_GetState(SYS_STATE_FS) == FS_DISK_ERROR
 | 
			
		||||
		|| System_GetState(SYS_STATE_FS) == FS_UNKNOWN_FORMAT
 | 
			
		||||
		|| System_GetState(SYS_STATE_FS) == FS_UNFORMATTED
 | 
			
		||||
| 
						 | 
				
			
			@ -226,13 +247,15 @@ static BOOL UIStrgCheckErr(MMC_DEV_TYPE dev_id)
 | 
			
		|||
 | 
			
		||||
BOOL UIStorageCheck(UINT32 uiCheckItem, UINT32 *pFreeCount)
 | 
			
		||||
{
 | 
			
		||||
#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
 | 
			
		||||
	SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev();
 | 
			
		||||
	if(mmc_dev->dcf_handle < 0)
 | 
			
		||||
	{
 | 
			
		||||
		DBG_ERR("No MMC_Dev Can use!\n");
 | 
			
		||||
		return FALSE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
	UINT32 useFileDB = 0;
 | 
			
		||||
	useFileDB = UI_GetData(FL_IsUseFileDB);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -243,7 +266,11 @@ BOOL UIStorageCheck(UINT32 uiCheckItem, UINT32 *pFreeCount)
 | 
			
		|||
		if (useFileDB) {
 | 
			
		||||
			return FALSE;
 | 
			
		||||
		} else {
 | 
			
		||||
		#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
			UIStrgCheckFolderFull(mmc_dev->dcf_handle);
 | 
			
		||||
		#else
 | 
			
		||||
			UIStrgCheckFolderFull(0);
 | 
			
		||||
		#endif
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	case STORAGE_CHECK_FULL:
 | 
			
		||||
| 
						 | 
				
			
			@ -258,7 +285,12 @@ BOOL UIStorageCheck(UINT32 uiCheckItem, UINT32 *pFreeCount)
 | 
			
		|||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	case STORAGE_CHECK_ERROR:
 | 
			
		||||
		UIStrgCheckErr(mmc_dev->dev_type);
 | 
			
		||||
	
 | 
			
		||||
		#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
			UIStrgCheckErr(mmc_dev->dev_type);
 | 
			
		||||
		#else
 | 
			
		||||
			UIStrgCheckErr(0);
 | 
			
		||||
		#endif
 | 
			
		||||
		break;
 | 
			
		||||
	case STORAGE_CHECK_DCIM_READONLY:
 | 
			
		||||
		if ((UIStorageCheck_DCIMWritable() == FALSE)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -747,7 +747,9 @@ INT32 PhotoFast_FileNaming_Open(void)
 | 
			
		|||
		}
 | 
			
		||||
 | 
			
		||||
		DCF_ScanObjEx(g_dcf_hdl);
 | 
			
		||||
#if USE_RTOS_MMC_CHECK
 | 
			
		||||
		SF_RtosStrgSetDcfHandle(MMC_DEV_SD,  g_dcf_hdl);
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
	else{
 | 
			
		||||
		DBG_WRN("dcf handle1 is already opened\n");
 | 
			
		||||
| 
						 | 
				
			
			@ -777,7 +779,9 @@ INT32 PhotoFast_FileNaming_Open2(void)
 | 
			
		|||
 | 
			
		||||
		DBG_WRN("DCF_ScanObjEx emmc handle=%d\n", g_dcf_hdl2);
 | 
			
		||||
		DCF_ScanObjEx(g_dcf_hdl2);
 | 
			
		||||
	#if USE_RTOS_MMC_CHECK
 | 
			
		||||
		SF_RtosStrgSetDcfHandle(MMC_DEV_EMMC, g_dcf_hdl2);
 | 
			
		||||
	#endif
 | 
			
		||||
	}
 | 
			
		||||
	else{
 | 
			
		||||
		DBG_WRN("dcf handle2 is already opened\n");
 | 
			
		||||
| 
						 | 
				
			
			@ -806,9 +810,11 @@ INT32 PhotoFast_FileNaming_Close(void)
 | 
			
		|||
 | 
			
		||||
		DCF_UnInstallID();
 | 
			
		||||
	}
 | 
			
		||||
#if USE_RTOS_MMC_CHECK
 | 
			
		||||
 | 
			
		||||
	SF_RtosStrgSetDcfHandle(MMC_DEV_SD,  g_dcf_hdl);
 | 
			
		||||
	SF_RtosStrgSetDcfHandle(MMC_DEV_EMMC, g_dcf_hdl2);
 | 
			
		||||
	
 | 
			
		||||
#endif	
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2389,6 +2389,7 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
 | 
			
		|||
    #endif
 | 
			
		||||
 | 
			
		||||
    #if HUNTING_CAMERA_MCU == ENABLE
 | 
			
		||||
	#if USE_RTOS_MMC_CHECK	
 | 
			
		||||
				SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev();
 | 
			
		||||
				if(mmc_dev->dcf_handle < 0)
 | 
			
		||||
				{
 | 
			
		||||
| 
						 | 
				
			
			@ -2405,6 +2406,9 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
 | 
			
		|||
						snprintf(tmp, sizeof(tmp), "%c%s%s", 'B', PHOTO_THUMB_PATH, file_path); /* DCF 8.3 naming rule */
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
	#else
 | 
			
		||||
				snprintf(tmp, sizeof(tmp), "%c%s%s", 'A', PHOTO_THUMB_PATH, file_path); /* DCF 8.3 naming rule */
 | 
			
		||||
	#endif
 | 
			
		||||
    #else
 | 
			
		||||
                UINT32 length = strlen(file_path);
 | 
			
		||||
                snprintf(tmp, sizeof(tmp), "%s%s", PHOTO_THUMB_PATH, file_path + length - 12); /* DCF 8.3 naming rule */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,8 @@
 | 
			
		|||
 | 
			
		||||
#define MMC_DEV_MAX_NUM (2)
 | 
			
		||||
 | 
			
		||||
#define USE_RTOS_MMC_CHECK 		(0)
 | 
			
		||||
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
	MMC_DEV_SD = 0,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user