Merge branch 'Branch_S550_Fast_Emmc' of http://192.168.6.216/linux-em-group/s530-ntk into Branch_S550_Fast_Emmc

This commit is contained in:
sober.song 2023-12-29 18:19:56 +08:00
commit f47a6c0b0b
9 changed files with 51 additions and 17 deletions

View File

@ -168,7 +168,7 @@ BOOL UIStorageCheck_DCIMWritable(void)
} }
{ {
ret = TRUE; //ret = TRUE;
DBG_IND("check_DCIM_writable: uiStatus=%d\r\n", uiStatus); DBG_IND("check_DCIM_writable: uiStatus=%d\r\n", uiStatus);
} }
return ret; return ret;
@ -217,7 +217,18 @@ static BOOL UIStrgCheckFull(UINT32 *pFreeCount)
*pFreeCount = uiCountTmp; *pFreeCount = uiCountTmp;
} }
if (uiCountTmp == 0) { if (uiCountTmp == 0) {
return TRUE; #if (USE_DCF == ENABLE)
if (DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT))
{
return FALSE;
}
else
{
return TRUE;
}
#else
return TRUE;
#endif
} else { } else {
return FALSE; return FALSE;
} }
@ -249,7 +260,13 @@ static BOOL UIStrgCheckErr(MMC_DEV_TYPE dev_id)
DBG_ERR("UIStorageCheck: %d Card Error\r\n", System_GetState(SYS_STATE_FS)); DBG_ERR("UIStorageCheck: %d Card Error\r\n", System_GetState(SYS_STATE_FS));
return TRUE; return TRUE;
} else { } else {
return FALSE; if (UIStorageCheck_DCIMWritable() == FALSE)
{
return TRUE;
}
else{
return FALSE;
}
} }
} }

View File

@ -696,15 +696,17 @@ static void update_storage_sd_card(void)
if (g_SysStrg_Chg) if (g_SysStrg_Chg)
{ {
static int cnt = 0; static int cnt = 0;
if(cnt++<3){ if(cnt++<1){
// lv_label_set_text(label_6_scr_uiflowphoto, "wait"); lv_label_set_text(label_6_scr_uiflowphoto, "Loarding...");
}else{ }else{
g_SysStrg_Chg = false; g_SysStrg_Chg = false;
cnt = 0; cnt = 0;
} }
} else if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE) } else if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE)
{ {
// lv_label_set_text(label_6_scr_uiflowphoto, "SD CARD ERROR"); if(UIStorageCheck_DCIMWritable() == FALSE){
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);
@ -843,7 +845,9 @@ static void update_camera_message(void)
default: default:
break; break;
} }
update_storage_message(); update_storage_message();
} }
extern int is_menu_screen_luck(void); extern int is_menu_screen_luck(void);
@ -1929,7 +1933,7 @@ static void UIFlowPhoto_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* m
{ {
g_SysStrg_Chg = false; g_SysStrg_Chg = false;
UIStorageCheck(STORAGE_CHECK_FULL, &g_uiFreePicNum); UIStorageCheck(STORAGE_CHECK_FULL, &g_uiFreePicNum);
printf("[*x]===================================================================================\n"); printf("[*x]====UI_StorageCheck: g_uiFreePicNum = 0x%ld\r\n", g_uiFreePicNum);
DBG_DUMP("UI_StorageCheck: g_uiFreePicNum = 0x%ld\r\n", g_uiFreePicNum); DBG_DUMP("UI_StorageCheck: g_uiFreePicNum = 0x%ld\r\n", g_uiFreePicNum);
lv_label_set_text(label_6_scr_uiflowphoto, Get_FreePicNumString(g_uiFreePicNum)); lv_label_set_text(label_6_scr_uiflowphoto, Get_FreePicNumString(g_uiFreePicNum));
break; break;

View File

@ -23,6 +23,10 @@ extern void UIFlowPhoto_update_selftimer_cnt(UINT32 time);
CHAR *Get_FreePicNumString(UINT32 uiValue) CHAR *Get_FreePicNumString(UINT32 uiValue)
{ {
if (System_GetState(SYS_STATE_FS) != FS_INIT_OK)
{
return 0;
}
unsigned long fileCount = 0; unsigned long fileCount = 0;
fileCount = DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT); fileCount = DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT);
snprintf(g_cFreePicNumStr, sizeof(g_cFreePicNumStr), "%05ld/%05ld", fileCount, uiValue); snprintf(g_cFreePicNumStr, sizeof(g_cFreePicNumStr), "%05ld/%05ld", fileCount, uiValue);

View File

@ -42,8 +42,15 @@ static void task_msgbox_timer_cb(lv_task_t* task)
UINT16 autoOffTime = sf_get_auto_off_time(); UINT16 autoOffTime = sf_get_auto_off_time();
const lv_plugin_string_t* string = lv_plugin_get_string(msgID); const lv_plugin_string_t* string = lv_plugin_get_string(msgID);
if (6000 == autoClose)
{
sf_set_pir_statu_flag(1);
}
if (0 == autoClose || autoOffTime <= 10) if (0 == autoClose || autoOffTime <= 10)
{ {
//sf_set_pir_statu_flag(0);
lv_task_del(msgbox_timer); lv_task_del(msgbox_timer);
msgbox_timer = NULL; msgbox_timer = NULL;
if (msgbox) if (msgbox)

View File

@ -289,8 +289,8 @@ void sf_mode_detect(void)
} }
else if(pwroffcnt == 6) else if(pwroffcnt == 6)
{ {
//LCD_BACKLIGHT_OFF; sf_sys_status_led_set(SF_LED_SYS_STATE_EXIT_GO_TO_PIR);
sf_sys_status_led_set(SF_LED_SYS_STATE_POWER_OFF); /*
printf("[power off] %s(%d) AutoOfftime:%d\n", __FUNCTION__, __LINE__, AutoOfftime); printf("[power off] %s(%d) AutoOfftime:%d\n", __FUNCTION__, __LINE__, AutoOfftime);
#define DO_NOT_SHOW_POWER_OFF 0 #define DO_NOT_SHOW_POWER_OFF 0
if(AutoOfftime >= KeepAliveTime_s) if(AutoOfftime >= KeepAliveTime_s)
@ -305,7 +305,7 @@ void sf_mode_detect(void)
Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); //shutdown start Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); //shutdown start
#endif #endif
} }
sf_set_power_off_flag(1); sf_set_power_off_flag(1);*/
} }
} }
else else

View File

View File

@ -90,7 +90,7 @@ static void card_insert_job2(void)
int ret; int ret;
FILE_TSK_INIT_PARAM Param = {0}; FILE_TSK_INIT_PARAM Param = {0};
FS_HANDLE StrgDXH2; FS_HANDLE StrgDXH2;
UINT32 start_sector = 16 ; /* linux cmd fdisk can list partition info */ UINT32 start_sector = 8192 ; /* linux cmd fdisk can list partition info */
UINT32 totoal_sectors = 0; UINT32 totoal_sectors = 0;
StrgDXH2 = (FS_HANDLE)sdio2_getStorageObject(STRG_OBJ_FAT1); StrgDXH2 = (FS_HANDLE)sdio2_getStorageObject(STRG_OBJ_FAT1);
STORAGE_OBJ* pStrg = sdio2_getStorageObject(STRG_OBJ_FAT1); STORAGE_OBJ* pStrg = sdio2_getStorageObject(STRG_OBJ_FAT1);

View File

@ -2248,7 +2248,7 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
if(param->cnt >= param->max_cnt) if(param->cnt >= param->max_cnt)
break; break;
#if SF_NO_SD_SEND == ENABLE #if SF_NO_SD_SEND == ENABLE
if(PhotoFast_Wait_FileSys(1) != E_OK){ if(PhotoFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK){
goto EXIT; goto EXIT;
} }
#endif #endif

View File

@ -2171,7 +2171,7 @@ void sf_file_thumb_cfg_sava(void)
UINT8 fileIndex = 0; UINT8 fileIndex = 0;
INT32 ret_fs = 0; INT32 ret_fs = 0;
FST_FILE_STATUS FileStat; FST_FILE_STATUS FileStat;
char tmp[64] = {'\0'};
UIMenuStoreInfo *puiPara = sf_ui_para_get(); UIMenuStoreInfo *puiPara = sf_ui_para_get();
if (pThumbFileCfg != NULL) { if (pThumbFileCfg != NULL) {
@ -2185,21 +2185,23 @@ void sf_file_thumb_cfg_sava(void)
#if SF_IQ_TEST != ENABLE #if SF_IQ_TEST != ENABLE
INT32 uiStatus = 0; INT32 uiStatus = 0;
UINT8 ucAttrib = 0; UINT8 ucAttrib = 0;
uiStatus = FileSys_GetAttrib(PHOTO_THUMB_PATH, &ucAttrib); snprintf(tmp, sizeof(tmp), "%c%s", 'A', PHOTO_THUMB_PATH);
uiStatus = FileSys_GetAttrib(tmp, &ucAttrib);
if (uiStatus == FST_STA_OK) { if (uiStatus == FST_STA_OK) {
if(!(ucAttrib&FST_ATTRIB_HIDDEN)){ if(!(ucAttrib&FST_ATTRIB_HIDDEN)){
FileSys_SetAttrib(PHOTO_THUMB_PATH, FST_ATTRIB_HIDDEN/* | FST_ATTRIB_SYSTEM*/, TRUE); FileSys_SetAttrib(tmp, FST_ATTRIB_HIDDEN/* | FST_ATTRIB_SYSTEM*/, TRUE);
} }
} }
#endif #endif
//printf("Add %s to send.List\n", sendfname); //printf("Add %s to send.List\n", sendfname);
if(0 == puiPara->SendType){ if(0 == puiPara->SendType){
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO); snprintf(sendListName, sizeof(sendListName), "A%s", SF_THUMB_SEND_AUTO);
fs = FileSys_OpenFile(sendListName, FST_CREATE_ALWAYS | FST_OPEN_WRITE); fs = FileSys_OpenFile(sendListName, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
}else { }else {
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST); snprintf(sendListName, sizeof(sendListName), "A%s", SF_THUMB_SEND_LIST);
fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE); fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
} }