1.sd卡循环增加异常目录处理,错误5次退出

This commit is contained in:
payton 2023-11-29 18:03:48 +08:00
parent 087c51cca8
commit 9cdfda03f5

View File

@ -767,8 +767,9 @@ int sf_app_sd_loop(void)
char cFileTmp[512] = {0}; char cFileTmp[512] = {0};
int iFileCount = 0; int iFileCount = 0;
int nloop = 1; int nloop = 1;
int nDirKey = 0, nFileKey = 0; UINT32 nDirKey = 0, nFileKey = 0;
SF_STORE_ATTR_S storeattrs = {0}; SF_STORE_ATTR_S storeattrs = {0};
int dircount = 0;
sf_dcf_resort_min(); sf_dcf_resort_min();
nDirKey = gLastDirKey; nDirKey = gLastDirKey;
@ -776,7 +777,7 @@ int sf_app_sd_loop(void)
MLOGD(" s\n"); MLOGD(" s\n");
while(nloop) while((nloop) && (dircount < 5))
{ {
sprintf(cPathTmp,"%s%s/%03d%s", SF_SD_ROOT, SF_DCF_ROOT_DIR_NAME, nDirKey, DCF_DIR_NAME); // ""/mnt/sd/DCIM/100MEDIA" sprintf(cPathTmp,"%s%s/%03d%s", SF_SD_ROOT, SF_DCF_ROOT_DIR_NAME, nDirKey, DCF_DIR_NAME); // ""/mnt/sd/DCIM/100MEDIA"
//Not Empty,Record File Name //Not Empty,Record File Name
@ -802,6 +803,14 @@ int sf_app_sd_loop(void)
//sleep(1); //sleep(1);
system("sync"); system("sync");
sf_dcf_resort_min(); sf_dcf_resort_min();
if(nDirKey == gLastDirKey)
{
dircount++;
}
else
{
dircount = 0;
}
nDirKey = gLastDirKey; nDirKey = gLastDirKey;
nFileKey = gLastFileKey; nFileKey = gLastFileKey;
continue; continue;