1.优化代码,减少打印;2.修改拔掉sd卡有报错问题

This commit is contained in:
payton 2024-01-11 20:54:49 +08:00
parent ebe50b5141
commit 6e489d41e0
4 changed files with 27 additions and 8 deletions

View File

@ -26,6 +26,7 @@
#if HUNTING_CAMERA_MCU == ENABLE
#include <sf_message_queue.h>
#include "sf_sd_common.h"
#endif
typedef struct
@ -131,7 +132,10 @@ static UINT32 SF_StrgSpaceCheckFull(MMC_DEV_TYPE mmc_dev)
/*check disk free size*/
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
{

View File

@ -777,7 +777,7 @@ DCF_HANDLE System_Get_DCF_Handle(void)
DBG_ERR("dcf_handle err!\n");
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;
#else
return 0;
@ -799,7 +799,7 @@ CHAR System_Get_DCF_Disk_Drive(DCF_HANDLE handle)
if(drive == '\0'){
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;
}

View File

@ -718,12 +718,15 @@ UINT32 PhotoExe_GetFreePicNum(void)
#if (FILESIZE_ALIGN_FUNC)
reserveSize += FS_ALIGN_RESERVED_SIZE;
#endif
uiFreeSpace = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
//uiFreeSpace = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
#if USE_MMC_DEV_CHECK
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)
{
@ -791,7 +794,10 @@ UINT32 PhotoExe_GetTotalPicNum(void)
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)
{

View File

@ -5,7 +5,7 @@
#include "UIFlowPhotoParams.h"
#include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h"
#include "ImageApp/ImageApp_Photo.h"
#include "sf_sd_common.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
///////////////////////////////////////////////////////////////////////////////
@ -48,7 +48,16 @@ CHAR *Get_FreePicNumString(UINT32 uiValue)
#if USE_MMC_DEV_CHECK
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
fileCount = DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT);