diff --git a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c index e75b8d901..a8c9f6249 100755 --- a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c +++ b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c @@ -44,6 +44,7 @@ SF_THREAD_S MMCMonitorTskCfg = }; #define MIN_DISK_FREE_SIZE_MB 300 +#define MIN_FREE_SIZE_MB 30 SF_ST_MMC_DEV *sf_mmc_dev[MMC_DEV_MAX_NUM] = {NULL}; @@ -140,7 +141,7 @@ static UINT32 SF_StrgSpaceCheckFull(MMC_DEV_TYPE mmc_dev) } diskFree = diskFree/1024/1024; - if(diskFree < MIN_DISK_FREE_SIZE_MB) /* 30MB */ + if(diskFree < (puiPara->SdLoopSwitch == 1 ? MIN_DISK_FREE_SIZE_MB : MIN_FREE_SIZE_MB)) /* 30MB OR 300MB */ { ret = 1; } diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c index e4792ea55..021acc7a9 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c @@ -58,24 +58,11 @@ static BOOL sf_is_4g_module_usb_update_file_exist(UINT8 *updateFname) struct dirent *ptr = NULL; UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); - UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */ - char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'A'; - if (font == 'B')// emmc - { - dirp=opendir((char *)"/mnt/sd2/"); - } - else - { - dirp=opendir((char *)"/mnt/sd/"); - } - //char *strg_path = sf_get_root_path(); - //printf("[%s:%d]path: %s\n", __FUNCTION__, __LINE__, strg_path); - //if(strg_path == NULL) - //{ - // free(strg_path); - // return FALSE; - //} - + //UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */ + //char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'A'; + + dirp=opendir((char *)"/mnt/sd2/"); + if (dirp != NULL) { //printf("[%s:%d] opendir success\n", __FUNCTION__, __LINE__); @@ -90,18 +77,11 @@ static BOOL sf_is_4g_module_usb_update_file_exist(UINT8 *updateFname) //printf("ptr->d_name: %s, puiPara->ModuleVer: %s\n", ptr->d_name, puiPara->ModuleVer); if(strncmp(ptr->d_name, puiPara->ModuleVer, 6) == 0) { - if (font == 'B')// emmc - { - sprintf((char*)updateFname, "%s%s", "/mnt/sd2/", ptr->d_name); - } - else - { - sprintf((char*)updateFname, "%s%s", "/mnt/sd/", ptr->d_name); - } + sprintf((char*)updateFname, "%s%s", "/mnt/sd2/", ptr->d_name); //sprintf((char*)updateFname, "%s%s", strg_path, ptr->d_name); closedir(dirp); //free(strg_path); - printf("[%s:%d] success strg_path:%s\n", __FUNCTION__, __LINE__, updateFname); + printf("[%s:%d] success emmc strg_path:%s\n", __FUNCTION__, __LINE__, updateFname); return TRUE; } } @@ -111,6 +91,30 @@ static BOOL sf_is_4g_module_usb_update_file_exist(UINT8 *updateFname) } } } + + dirp=opendir((char *)"/mnt/sd/"); + if (dirp != NULL) + { + while ((ptr=readdir(dirp)) != NULL) + { + if(strcmp(ptr->d_name,".")==0 || strcmp(ptr->d_name,"..")==0) ///current dir OR parrent dir + continue; + else if(ptr->d_type == 4) ///dir + { + if(strncmp(ptr->d_name, puiPara->ModuleVer, 6) == 0) + { + sprintf((char*)updateFname, "%s%s", "/mnt/sd/", ptr->d_name); + closedir(dirp); + printf("[%s:%d] success sd card strg_path:%s\n", __FUNCTION__, __LINE__, updateFname); + return TRUE; + } + } + else + { + continue; + } + } + } closedir(dirp); //free(strg_path); diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c index a9aafb0b7..c2c47f429 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c @@ -1254,7 +1254,7 @@ static void UIFlowPhoto_OnExeCaptureStart(lv_obj_t* obj) { if (FlowPhoto_IsStorageErr() == TRUE) { DBG_ERR("UIFlowPhoto_OnKeyShutter2: storage err!\r\n"); - return; +// return; } switch (gPhotoData.State) {