Merge:Emmc function in photo screen.
This commit is contained in:
parent
9c6521aa27
commit
e04817b6ab
|
@ -670,15 +670,21 @@ static void update_gps_status(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enum STORAGE_TYPE
|
|
||||||
{
|
|
||||||
STORAGE_TYPE_EMMC = 0,
|
|
||||||
STORAGE_TYPE_SD_CARD,
|
|
||||||
STORAGE_TYPE_END
|
|
||||||
};
|
|
||||||
int get_storage_type(void)
|
int get_storage_type(void)
|
||||||
{
|
{
|
||||||
return STORAGE_TYPE_SD_CARD;
|
return MMC_DEV_SD;
|
||||||
|
SF_ST_MMC_DEV *mmc_dev = SF_StrgCheckWorkableDev();
|
||||||
|
if (NULL == mmc_dev)
|
||||||
|
{
|
||||||
|
DBG_ERR("SF_StrgCheckWorkableDev return null.\n");
|
||||||
|
return MMC_DEV_NO;
|
||||||
|
}
|
||||||
|
if(mmc_dev->dcf_handle < 0)
|
||||||
|
{
|
||||||
|
DBG_ERR("No MMC_Dev Can use!\n");
|
||||||
|
return MMC_DEV_NO;
|
||||||
|
}
|
||||||
|
return mmc_dev->dev_type;
|
||||||
}
|
}
|
||||||
static void update_storage_sd_card(void)
|
static void update_storage_sd_card(void)
|
||||||
{
|
{
|
||||||
|
@ -723,6 +729,37 @@ static void update_storage_sd_card(void)
|
||||||
lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card");
|
lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
unsigned int check_sd_size(UINT64 diskSize)
|
||||||
|
{
|
||||||
|
// printf("========================================= %llu\n", diskSize);
|
||||||
|
// printf("========================================= %llu G\n", diskSize/(1024 * 1024 * 1024));
|
||||||
|
unsigned int size = diskSize/ (1024 * 1024 * 1024);
|
||||||
|
if (0 < size && size < 12)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (12 <= size && size < 24)
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
if (24 <= size && size < 48)
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
if (48 <= size && size < 96)
|
||||||
|
{
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
if (96 <= size && size < 192)
|
||||||
|
{
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
if (192 <= size && size < 384)
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
static void update_sd_card_status(lv_obj_t* obj)
|
static void update_sd_card_status(lv_obj_t* obj)
|
||||||
{
|
{
|
||||||
lv_plugin_res_id res[] = {
|
lv_plugin_res_id res[] = {
|
||||||
|
@ -732,16 +769,23 @@ static void update_sd_card_status(lv_obj_t* obj)
|
||||||
LV_PLUGIN_IMG_ID_SF_SD_32GB,
|
LV_PLUGIN_IMG_ID_SF_SD_32GB,
|
||||||
LV_PLUGIN_IMG_ID_SF_SD_64GB,
|
LV_PLUGIN_IMG_ID_SF_SD_64GB,
|
||||||
LV_PLUGIN_IMG_ID_SF_SD_128GB,
|
LV_PLUGIN_IMG_ID_SF_SD_128GB,
|
||||||
LV_PLUGIN_IMG_ID_SF_SD_256GB
|
LV_PLUGIN_IMG_ID_SF_SD_256GB,
|
||||||
|
LV_PLUGIN_IMG_ID_SF_SD_FULL
|
||||||
};
|
};
|
||||||
int index = 5;
|
UINT64 diskSize = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE);
|
||||||
|
unsigned int index = check_sd_size(diskSize);
|
||||||
|
if (index > 7)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
lv_plugin_img_set_src(obj, res[index]);
|
lv_plugin_img_set_src(obj, res[index]);
|
||||||
}
|
}
|
||||||
static void update_storage_message(void)
|
static void update_storage_message(void)
|
||||||
{
|
{
|
||||||
if (STORAGE_TYPE_EMMC == get_storage_type()) {
|
if (MMC_DEV_EMMC == get_storage_type()) {
|
||||||
lv_plugin_img_set_src(image_8_scr_uiflowphoto, LV_PLUGIN_IMG_ID_SF_SD_EMMC);
|
lv_plugin_img_set_src(image_8_scr_uiflowphoto, LV_PLUGIN_IMG_ID_SF_SD_EMMC);
|
||||||
update_sd_card_status(image_9_scr_uiflowphoto);
|
update_sd_card_status(image_9_scr_uiflowphoto);
|
||||||
|
update_storage_sd_card();
|
||||||
} else {
|
} else {
|
||||||
update_sd_card_status(image_8_scr_uiflowphoto);
|
update_sd_card_status(image_8_scr_uiflowphoto);
|
||||||
lv_plugin_img_set_src(image_9_scr_uiflowphoto, LV_PLUGIN_IMG_ID_SF_SD_EMMC_DIS);
|
lv_plugin_img_set_src(image_9_scr_uiflowphoto, LV_PLUGIN_IMG_ID_SF_SD_EMMC_DIS);
|
||||||
|
@ -752,6 +796,7 @@ static void update_camera_message(void)
|
||||||
{
|
{
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
// if((puiPara->CamMode == SF_CAM_MODE_PHOTO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO))
|
// if((puiPara->CamMode == SF_CAM_MODE_PHOTO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO))
|
||||||
|
|
||||||
switch (puiPara->ImgSize)
|
switch (puiPara->ImgSize)
|
||||||
{
|
{
|
||||||
case PHOTO_SIZE_40M:
|
case PHOTO_SIZE_40M:
|
||||||
|
|
|
@ -237,12 +237,12 @@ void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key)
|
||||||
update_play_Selection_msg(obj);
|
update_play_Selection_msg(obj);
|
||||||
break;
|
break;
|
||||||
case LV_USER_KEY_LEFT:
|
case LV_USER_KEY_LEFT:
|
||||||
if (OPTION_PAGE_SELECT_FUNCTION == gOptionPage) {
|
// if (OPTION_PAGE_SELECT_FUNCTION == gOptionPage) {
|
||||||
hide_Selection_page();
|
// hide_Selection_page();
|
||||||
} else {
|
// } else {
|
||||||
gOptionPage = OPTION_PAGE_SELECT_FUNCTION;
|
// gOptionPage = OPTION_PAGE_SELECT_FUNCTION;
|
||||||
show_Selection_page(obj);
|
// show_Selection_page(obj);
|
||||||
}
|
// }
|
||||||
break;
|
break;
|
||||||
case LV_USER_KEY_RIGHT:
|
case LV_USER_KEY_RIGHT:
|
||||||
case LV_KEY_ENTER:
|
case LV_KEY_ENTER:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user