From 49bdf2d6c5a1af690e3d895d7c564dbdd041ed86 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 5 Jan 2024 21:03:37 +0800 Subject: [PATCH] =?UTF-8?q?1.rtos=E4=B8=8B=E5=8D=A1=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardv/SrcCode/UIApp/MovieFast/MovieFast.c | 17 +++++++++++------ .../cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c | 10 ++++++++-- .../UIApp/PhotoFast/PhotoFastSliceEncode.c | 2 +- 3 files changed, 20 insertions(+), 9 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 6becb00d9..69a58a537 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c @@ -868,7 +868,12 @@ static DCF_HANDLE MovieFast_Get_DCF_Handle(void) //#endif SF_RtosStrgSetDcfHandle(MMC_DEV_SD, g_dcf_hdl); SF_RtosStrgSetDcfHandle(MMC_DEV_EMMC, g_dcf_hdl2); - +#if SF_AGEING_EMMC_TEST == ENABLE + return g_dcf_hdl2; +#endif +#if SF_AGEING_SD_TEST == ENABLE + return g_dcf_hdl; +#endif #if USE_RTOS_MMC_CHECK SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); if(mmc_dev ==NULL) @@ -1077,7 +1082,7 @@ static void MovieFast_WriteFile_Task(void* arg) MovieFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS); #if HUNTING_CAMERA_MCU == ENABLE - if(TRUE == sf_is_card_full()) + if(TRUE == sf_is_card_full() && TRUE == sf_is_emmc_full()) { DBG_ERR("ERR card full\r\n"); //return ; @@ -1094,7 +1099,7 @@ static void MovieFast_WriteFile_Task(void* arg) if(param->va){ DBG_DUMP("Write %s\n", param->path); #if HUNTING_CAMERA_MCU == ENABLE - if(TRUE != sf_is_card_full()) + if(TRUE != sf_is_card_full() || TRUE != sf_is_emmc_full()) #endif { FST_FILE fp = FileSys_OpenFile(param->path, FST_OPEN_ALWAYS | FST_OPEN_WRITE); @@ -1105,9 +1110,9 @@ static void MovieFast_WriteFile_Task(void* arg) free(param->va); } else if(param->frame.phy_addr[0]){ - DBG_DUMP("Write %s\n", param->path); + DBG_DUMP("Write2 %s\n", param->path); #if HUNTING_CAMERA_MCU == ENABLE - if(TRUE != sf_is_card_full()) + if(TRUE != sf_is_card_full() || TRUE != sf_is_emmc_full()) #endif { FST_FILE fp = FileSys_OpenFile(param->path, FST_OPEN_ALWAYS | FST_OPEN_WRITE); @@ -1358,7 +1363,7 @@ THREAD_RETTYPE MovieFast_InitFileNamingThread2(void *arg) DCF_ScanObjEx(g_dcf_hdl2); #if HUNTING_CAMERA_MCU == ENABLE - if(TRUE != sf_is_card_full()) + if(TRUE != sf_is_emmc_full()) #endif { #if USE_RTOS_MMC_CHECK 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 d50543ea2..c6a759bc9 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c @@ -939,6 +939,12 @@ DCF_HANDLE PhotoFast_Get_DCF_Handle() SF_RtosStrgSetDcfHandle(MMC_DEV_SD, g_dcf_hdl); SF_RtosStrgSetDcfHandle(MMC_DEV_EMMC, g_dcf_hdl2); +#if SF_AGEING_EMMC_TEST == ENABLE + return g_dcf_hdl2; +#endif +#if SF_AGEING_SD_TEST == ENABLE + return g_dcf_hdl; +#endif #if USE_RTOS_MMC_CHECK SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); if(mmc_dev ==NULL) @@ -1070,7 +1076,7 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, //sprintf(tmp, "W%03ld%04ld.JPG", nextFolderID, nextFileID); strncpy(g_photo_fast_write_file_Path, tmp, sizeof(g_photo_fast_write_file_Path) - 1); DBG_IND("last send file:%s\r\n", tmp); - if(TRUE == sf_is_card_full()) + if(TRUE == sf_is_card_full() && TRUE == sf_is_emmc_full()) { DBG_ERR("ERR Addr=0x%x,Size=0x%x,Fmt=%d card full\r\n", Addr, Size, Fmt); rt =FST_STA_ERROR; @@ -2010,7 +2016,7 @@ exit: #if SF_TRIGGER_TIME_TEST == ENABLE sf_trigger_time_led_cb(0); #endif - if((sf_get_power_off_flag()) || (TRUE == sf_is_card_full())) + if((sf_get_power_off_flag()) || (TRUE == sf_is_card_full() && TRUE == sf_is_emmc_full())) { vos_flag_set(PHOTOFAST_FLG_ID, FLGPHOTOFAST_SHUTDOWN); } diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c index 7815d000b..75f9a032c 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c @@ -2419,7 +2419,7 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data) DBG_IND("PHOTO THUMB %s\n", tmp); vos_perf_mark(&t3); - if(FALSE == sf_is_card_full()) + if((TRUE != sf_is_card_full() && (mmc_dev->dev_type == MMC_DEV_SD)) || (TRUE != sf_is_emmc_full() && (mmc_dev->dev_type == MMC_DEV_EMMC))) { FST_FILE fp = FileSys_OpenFile(tmp, FST_CREATE_ALWAYS | FST_OPEN_WRITE);