From 407e190db8bb14b13e71a43a8de8a626161fc8d9 Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 25 Jan 2024 18:01:15 +0800 Subject: [PATCH] =?UTF-8?q?1.Wait=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardv/SrcCode/UIApp/MovieFast/MovieFast.c | 4 +-- .../cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c | 27 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c index 35aeb532a..7a8f1088e 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c @@ -1175,7 +1175,7 @@ static void MovieFast_WriteFile_Task(void* arg) lfqueue_t* queue = (lfqueue_t*)arg; MOVIEFAST_WRITE_QUEUE_PARAM* param; - MovieFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS); + PhotoFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS); #if HUNTING_CAMERA_MCU == ENABLE if(TRUE == sf_is_card_full() && TRUE == sf_is_emmc_full()) { @@ -1387,7 +1387,7 @@ static void MovieFast_UserEventCb(UINT32 id, MOVIE_USER_CB_EVENT event_id, UINT3 case MOVIE_USER_CB_EVENT_FILENAMING_EMR_CB: { CHAR *pFileName = (CHAR *) value; - if(MovieFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) == E_OK && MovieFast_Wait_FileNaming(FASTBOOT_WAIT_FILENAMING_TIMEOUT_MS) == E_OK){ + if(PhotoFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) == E_OK && PhotoFast_Wait_FileNaming(FASTBOOT_WAIT_FILENAMING_TIMEOUT_MS) == E_OK){ MovieFast_FileNamingCB(id, pFileName); } else{ diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c index ed3b65d66..9c42931d8 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c @@ -981,8 +981,14 @@ INT32 PhotoFast_Wait_FileSys(UINT32 timeout_ms) // boot_init = BOOT_INIT_FILESYSOK_2; // } // #endif - INT32 ret = E_SYS; + static INT32 ret = E_SYS; + static int flag = 0; + if(flag) + { + return ret; + } + flag = 1; if(gpio_getPin(GPIO_CARD_DETECT) == 0) { //DBG_WRN("BOOT_INIT_FILESYSOK\n"); @@ -993,13 +999,13 @@ INT32 PhotoFast_Wait_FileSys(UINT32 timeout_ms) //DBG_WRN("ret1:%d, ret2:%d\n", ret, ret2); if(ret == E_OK || ret2 == E_OK) { - return E_OK; + ret = E_OK; } else { DBG_ERR("boot_init = BOOT_INIT_INVALID\n"); - return E_SYS; + ret = E_SYS; } - + return ret; // if(boot_init != BOOT_INIT_INVALID) // return fastboot_wait_done_timeout(boot_init, timeout_ms); // else{ @@ -1011,8 +1017,16 @@ INT32 PhotoFast_Wait_FileSys(UINT32 timeout_ms) INT32 PhotoFast_Wait_FileNaming(UINT32 timeout_ms) { //DCF_HANDLE handle = MovieFast_Get_DCF_Handle(); + static INT32 ret = E_SYS; + static int flag = 0; BOOT_INIT boot_init = BOOT_INIT_INVALID; + if(flag) + { + return ret; + } + flag = 1; + SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); if(mmc_dev ==NULL) { @@ -1033,12 +1047,13 @@ INT32 PhotoFast_Wait_FileNaming(UINT32 timeout_ms) if(boot_init != BOOT_INIT_INVALID) { - return fastboot_wait_done_timeout(boot_init, timeout_ms); + ret = fastboot_wait_done_timeout(boot_init, timeout_ms); } else{ DBG_ERR("boot_init = BOOT_INIT_INVALID\n"); - return E_SYS; + ret = E_SYS; } + return ret; } INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, char* Path)