预览界面切换优化, 10689emmc和sd卡状态优化

This commit is contained in:
xiehongyan 2024-01-11 13:42:38 +08:00
parent 1a9b871afa
commit ad2f09213a
2 changed files with 55 additions and 22 deletions

View File

@ -75,6 +75,8 @@ static BOOL g_SysStrg_Chg = true;
static int cnt = 0; static int cnt = 0;
#define FREE_SIZE_MB 30
static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key); static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key);
static void sf_show_send_text(lv_obj_t* obj, const unsigned short status); static void sf_show_send_text(lv_obj_t* obj, const unsigned short status);
static lv_obj_t *g_preview_info_msgbox = NULL; static lv_obj_t *g_preview_info_msgbox = NULL;
@ -695,8 +697,6 @@ static void update_storage_sd_card(void)
if (MMC_DEV_SD == storageType && cardStatus == CARD_REMOVED) if (MMC_DEV_SD == storageType && cardStatus == CARD_REMOVED)
{ {
set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card");
return; return;
} }
// if (cardStatus != CARD_REMOVED) // if (cardStatus != CARD_REMOVED)
@ -704,15 +704,15 @@ static void update_storage_sd_card(void)
if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE) if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE)
{ {
if(UIStorageCheck_DCIMWritable() == FALSE){ // if(UIStorageCheck_DCIMWritable() == FALSE){
set_warning_label_text(label_6_scr_uiflowphoto); // set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "SD Card Error"); // lv_label_set_text(label_6_scr_uiflowphoto, "SD Card Error");
} // }
} }
else if (UIStorageCheck(STORAGE_CHECK_FULL, NULL) == TRUE) else if (UIStorageCheck(STORAGE_CHECK_FULL, NULL) == TRUE)
{ {
set_warning_label_text(label_6_scr_uiflowphoto); //set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "SD Card FULL"); //lv_label_set_text(label_6_scr_uiflowphoto, "SD Card FULL");
} }
else else
{ {
@ -790,44 +790,71 @@ static void update_sd_card_status(lv_obj_t* obj)
LV_PLUGIN_IMG_ID_SF_SD_256GB, LV_PLUGIN_IMG_ID_SF_SD_256GB,
LV_PLUGIN_IMG_ID_SF_SD_FULL LV_PLUGIN_IMG_ID_SF_SD_FULL
}; };
UINT64 diskSize = 0; UINT64 diskSize = 0;
UINT64 diskFree = 0;
unsigned int index = 0; unsigned int index = 0;
UINT32 cardStatus = System_GetState(SYS_STATE_CARD); UINT32 cardStatus = System_GetState(SYS_STATE_CARD);
if (cardStatus != CARD_REMOVED) if (cardStatus != CARD_REMOVED)
{ {
if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE && UIStorageCheck(STORAGE_CHECK_FULL, NULL) != TRUE) diskSize = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE);
diskFree = FileSys_GetDiskInfoEx('A', FST_INFO_FREE_SPACE);
//printf("[%s]SD Card disk size : %lld, disk free : %lld\n", __FUNCTION__, diskSize, diskFree);
if (0 == diskSize)
{ {
lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_SD_DIS); //printf("[%s]SD CARD ERROR :%lld\n", __FUNCTION__, diskSize);
lv_plugin_img_set_src(image_9_scr_uiflowphoto, LV_PLUGIN_IMG_ID_SF_SD_DIS);
set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "SD Card Error");
return; return;
} }
else if (UIStorageCheck(STORAGE_CHECK_FULL, NULL) == TRUE) else if (diskFree < (FREE_SIZE_MB*1024*1024))
{ {
//printf("[%s]SD CARD FULL :%lld\n", __FUNCTION__, diskFree);
lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_SD_FULL); lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_SD_FULL);
set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "SD Card FULL");
return; return;
} }
else else
{ {
diskSize = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE); //printf("[%s]SD CARD NORMAL :%lld\n", __FUNCTION__, diskFree);
index = check_sd_size(diskSize); index = check_sd_size(diskSize);
} }
} }
else
{
set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card");
}
lv_plugin_img_set_src(obj, res[index]); lv_plugin_img_set_src(obj, res[index]);
} }
static void update_emmc_status(lv_obj_t* obj) static void update_emmc_status(lv_obj_t* obj)
{ {
SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev(); UINT64 diskSize = FileSys_GetDiskInfoEx('B', FST_INFO_DISK_SIZE);
if (MMC_DEV_SPACE_STATE_NO_ENOUGH == mmc_dev->space_state) UINT64 diskFree = FileSys_GetDiskInfoEx('B', FST_INFO_FREE_SPACE);
{ //SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev();
lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_EMMC_FULL); //printf("[%s]EMMC disk size : %lld, disk free : %lld\n", __FUNCTION__, diskSize, diskFree);
} //if (MMC_DEV_SPACE_STATE_NO_ENOUGH == mmc_dev->space_state)
else if (MMC_DEV_MOUNT_STATE_UNMOUNTED == mmc_dev->moumted_state) if (0 == diskSize)
{ {
//printf("[%s]EMMC ERROR :%lld\n", __FUNCTION__, diskSize);
lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_SD_EMMC_DIS); lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_SD_EMMC_DIS);
set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "EMMC Error");
} }
else if(diskFree < (FREE_SIZE_MB*1024*1024))
{
//printf("[%s]EMMC FULL :%lld\n", __FUNCTION__, diskFree);
lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_EMMC_FULL);
set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "EMMC FULL");
}
//else if (MMC_DEV_MOUNT_STATE_UNMOUNTED == mmc_dev->moumted_state)
else else
{ {
//printf("[%s]EMMC NORMAL :%lld\n", __FUNCTION__, diskFree);
lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_SD_EMMC); lv_plugin_img_set_src(obj, LV_PLUGIN_IMG_ID_SF_SD_EMMC);
} }
@ -840,7 +867,6 @@ static void update_storage_message(void)
set_normal_label_text(label_6_scr_uiflowphoto); set_normal_label_text(label_6_scr_uiflowphoto);
if(cnt<3){ if(cnt<3){
printf("[+==========================================]");
cnt++; cnt++;
set_normal_label_text(label_6_scr_uiflowphoto); set_normal_label_text(label_6_scr_uiflowphoto);
//lv_label_set_text(label_6_scr_uiflowphoto, ""); //lv_label_set_text(label_6_scr_uiflowphoto, "");
@ -855,8 +881,8 @@ static void update_storage_message(void)
if (MMC_DEV_SD == get_storage_type()) if (MMC_DEV_SD == get_storage_type())
{ {
//printf("[%s]SD storage\n", __FUNCTION__); //printf("[%s]SD storage\n", __FUNCTION__);
update_sd_card_status(image_8_scr_uiflowphoto);
update_emmc_status(image_9_scr_uiflowphoto); update_emmc_status(image_9_scr_uiflowphoto);
update_sd_card_status(image_8_scr_uiflowphoto);
update_storage_sd_card(); update_storage_sd_card();
} }
else if (MMC_DEV_EMMC == get_storage_type()) else if (MMC_DEV_EMMC == get_storage_type())

View File

@ -2443,6 +2443,13 @@ static void UIFlowPlay_Key(lv_obj_t* obj, uint32_t key)
case LV_USER_KEY_NEXT: case LV_USER_KEY_NEXT:
{ {
if (SELECTION_SHOW_FALSE == gSeletionShow) { if (SELECTION_SHOW_FALSE == gSeletionShow) {
UINT32 uiFileSeq;
PB_GetParam(PBPRMID_CURR_FILESEQ, &uiFileSeq);
if (0 != uiFileSeq)
{
stop_play();
UIFlowPlay_OnKeyUp(obj);
}
show_Selection_page(obj); show_Selection_page(obj);
lv_obj_set_hidden(no_file_msgbox, true); lv_obj_set_hidden(no_file_msgbox, true);