无卡无emmc执行内存发送, 模块升级菜单逻辑修改

This commit is contained in:
xiehongyan 2024-01-17 19:37:19 +08:00
parent 118cb7226f
commit 1a19a95e5d
3 changed files with 34 additions and 29 deletions

View File

@ -44,6 +44,7 @@ SF_THREAD_S MMCMonitorTskCfg =
}; };
#define MIN_DISK_FREE_SIZE_MB 300 #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}; 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; 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; ret = 1;
} }

View File

@ -58,23 +58,10 @@ static BOOL sf_is_4g_module_usb_update_file_exist(UINT8 *updateFname)
struct dirent *ptr = NULL; struct dirent *ptr = NULL;
UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */ //UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */
char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'A'; //char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'A';
if (font == 'B')// emmc
{
dirp=opendir((char *)"/mnt/sd2/"); 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;
//}
if (dirp != NULL) if (dirp != NULL)
{ {
@ -89,19 +76,36 @@ static BOOL sf_is_4g_module_usb_update_file_exist(UINT8 *updateFname)
//printf("[%s:%d] success strg_path:%s\n", __FUNCTION__, __LINE__, strg_path); //printf("[%s:%d] success strg_path:%s\n", __FUNCTION__, __LINE__, strg_path);
//printf("ptr->d_name: %s, puiPara->ModuleVer: %s\n", ptr->d_name, puiPara->ModuleVer); //printf("ptr->d_name: %s, puiPara->ModuleVer: %s\n", ptr->d_name, puiPara->ModuleVer);
if(strncmp(ptr->d_name, puiPara->ModuleVer, 6) == 0) if(strncmp(ptr->d_name, puiPara->ModuleVer, 6) == 0)
{
if (font == 'B')// emmc
{ {
sprintf((char*)updateFname, "%s%s", "/mnt/sd2/", ptr->d_name); 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", strg_path, ptr->d_name); //sprintf((char*)updateFname, "%s%s", strg_path, ptr->d_name);
closedir(dirp); closedir(dirp);
//free(strg_path); //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;
}
}
else
{
continue;
}
}
}
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; return TRUE;
} }
} }

View File

@ -1254,7 +1254,7 @@ static void UIFlowPhoto_OnExeCaptureStart(lv_obj_t* obj)
{ {
if (FlowPhoto_IsStorageErr() == TRUE) { if (FlowPhoto_IsStorageErr() == TRUE) {
DBG_ERR("UIFlowPhoto_OnKeyShutter2: storage err!\r\n"); DBG_ERR("UIFlowPhoto_OnKeyShutter2: storage err!\r\n");
return; // return;
} }
switch (gPhotoData.State) { switch (gPhotoData.State) {