1.优化代码,减少打印;2.修改拔掉sd卡有报错问题
This commit is contained in:
parent
ebe50b5141
commit
6e489d41e0
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
#include <sf_message_queue.h>
|
#include <sf_message_queue.h>
|
||||||
|
#include "sf_sd_common.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -131,7 +132,10 @@ static UINT32 SF_StrgSpaceCheckFull(MMC_DEV_TYPE mmc_dev)
|
||||||
/*check disk free size*/
|
/*check disk free size*/
|
||||||
if(mmc_dev == MMC_DEV_SD)
|
if(mmc_dev == MMC_DEV_SD)
|
||||||
{
|
{
|
||||||
diskFree = FileSys_GetDiskInfoEx('A', FST_INFO_FREE_SPACE);
|
if(sf_in_card_exist())
|
||||||
|
{
|
||||||
|
diskFree = FileSys_GetDiskInfoEx('A', FST_INFO_FREE_SPACE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -777,7 +777,7 @@ DCF_HANDLE System_Get_DCF_Handle(void)
|
||||||
DBG_ERR("dcf_handle err!\n");
|
DBG_ERR("dcf_handle err!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
DBG_WRN("DCF_GET_HANDLE, %d\n", mmc_dev->dcf_handle);
|
//DBG_WRN("DCF_GET_HANDLE, %d\n", mmc_dev->dcf_handle);
|
||||||
return mmc_dev->dcf_handle;
|
return mmc_dev->dcf_handle;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -799,7 +799,7 @@ CHAR System_Get_DCF_Disk_Drive(DCF_HANDLE handle)
|
||||||
if(drive == '\0'){
|
if(drive == '\0'){
|
||||||
DBG_ERR("invalid act handle(%d)\n", handle);
|
DBG_ERR("invalid act handle(%d)\n", handle);
|
||||||
}
|
}
|
||||||
DBG_WRN("get disk driver, %c\n", drive);
|
//DBG_WRN("get disk driver, %c\n", drive);
|
||||||
return drive;
|
return drive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -718,12 +718,15 @@ UINT32 PhotoExe_GetFreePicNum(void)
|
||||||
#if (FILESIZE_ALIGN_FUNC)
|
#if (FILESIZE_ALIGN_FUNC)
|
||||||
reserveSize += FS_ALIGN_RESERVED_SIZE;
|
reserveSize += FS_ALIGN_RESERVED_SIZE;
|
||||||
#endif
|
#endif
|
||||||
uiFreeSpace = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
|
//uiFreeSpace = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
|
||||||
#if USE_MMC_DEV_CHECK
|
#if USE_MMC_DEV_CHECK
|
||||||
|
|
||||||
if(mmc_dev->dev_type == MMC_DEV_SD)
|
if(mmc_dev->dev_type == MMC_DEV_SD)
|
||||||
{
|
{
|
||||||
uiFreeSpace = FileSys_GetDiskInfoEx('A', FST_INFO_FREE_SPACE);
|
if(sf_in_card_exist() == TRUE)
|
||||||
|
{
|
||||||
|
uiFreeSpace = FileSys_GetDiskInfoEx('A', FST_INFO_FREE_SPACE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(mmc_dev->dev_type == MMC_DEV_EMMC)
|
else if(mmc_dev->dev_type == MMC_DEV_EMMC)
|
||||||
{
|
{
|
||||||
|
@ -791,7 +794,10 @@ UINT32 PhotoExe_GetTotalPicNum(void)
|
||||||
|
|
||||||
if(mmc_dev->dev_type == MMC_DEV_SD)
|
if(mmc_dev->dev_type == MMC_DEV_SD)
|
||||||
{
|
{
|
||||||
uiSpace = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE);
|
if(sf_in_card_exist() == TRUE)
|
||||||
|
{
|
||||||
|
uiSpace = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(mmc_dev->dev_type == MMC_DEV_EMMC)
|
else if(mmc_dev->dev_type == MMC_DEV_EMMC)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "UIFlowPhotoParams.h"
|
#include "UIFlowPhotoParams.h"
|
||||||
#include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h"
|
#include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h"
|
||||||
#include "ImageApp/ImageApp_Photo.h"
|
#include "ImageApp/ImageApp_Photo.h"
|
||||||
|
#include "sf_sd_common.h"
|
||||||
#include "DCF.h"
|
#include "DCF.h"
|
||||||
#define THIS_DBGLVL 2 // 0=FATAL, 1=ERR, 2=WRN, 3=UNIT, 4=FUNC, 5=IND, 6=MSG, 7=VALUE, 8=USER
|
#define THIS_DBGLVL 2 // 0=FATAL, 1=ERR, 2=WRN, 3=UNIT, 4=FUNC, 5=IND, 6=MSG, 7=VALUE, 8=USER
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -48,7 +48,16 @@ CHAR *Get_FreePicNumString(UINT32 uiValue)
|
||||||
#if USE_MMC_DEV_CHECK
|
#if USE_MMC_DEV_CHECK
|
||||||
if(mmc_dev->dev_type != MMC_DEV_NO)
|
if(mmc_dev->dev_type != MMC_DEV_NO)
|
||||||
{
|
{
|
||||||
fileCount = DCF_GetDBInfoEx(mmc_dev->dcf_handle, DCF_INFO_TOL_FILE_COUNT);
|
if(MMC_DEV_SD == mmc_dev->dev_type)
|
||||||
|
{
|
||||||
|
if(sf_in_card_exist())
|
||||||
|
{
|
||||||
|
fileCount = DCF_GetDBInfoEx(mmc_dev->dcf_handle, DCF_INFO_TOL_FILE_COUNT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fileCount = DCF_GetDBInfoEx(mmc_dev->dcf_handle, DCF_INFO_TOL_FILE_COUNT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
fileCount = DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT);
|
fileCount = DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user