diff --git a/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c b/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c index d13ab4996..537c60a1e 100644 --- a/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c +++ b/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c @@ -767,8 +767,9 @@ int sf_app_sd_loop(void) char cFileTmp[512] = {0}; int iFileCount = 0; int nloop = 1; - int nDirKey = 0, nFileKey = 0; + UINT32 nDirKey = 0, nFileKey = 0; SF_STORE_ATTR_S storeattrs = {0}; + int dircount = 0; sf_dcf_resort_min(); nDirKey = gLastDirKey; @@ -776,7 +777,7 @@ int sf_app_sd_loop(void) 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" //Not Empty,Record File Name @@ -802,6 +803,14 @@ int sf_app_sd_loop(void) //sleep(1); system("sync"); sf_dcf_resort_min(); + if(nDirKey == gLastDirKey) + { + dircount++; + } + else + { + dircount = 0; + } nDirKey = gLastDirKey; nFileKey = gLastFileKey; continue;