1.30M剩余判断处理

This commit is contained in:
payton 2023-11-07 21:52:08 +08:00
parent 49c47f0edc
commit 53bf5442ed
5 changed files with 64 additions and 40 deletions

View File

@ -12,6 +12,9 @@
#include "sys_fastboot.h" #include "sys_fastboot.h"
#include "PrjCfg.h" #include "PrjCfg.h"
#include "DxHunting.h" #include "DxHunting.h"
#if HUNTING_CAMERA_MCU == ENABLE
#include <sf_mcu.h>
#endif
#if (HUNTING_CAMERA_MODEL == ENABLE) #if (HUNTING_CAMERA_MODEL == ENABLE)
#include "IOCfg.h" #include "IOCfg.h"
@ -56,6 +59,13 @@ static void card_insert_job(void)
// call the function to wait init finish // call the function to wait init finish
FileSys_WaitFinishEx('A'); FileSys_WaitFinishEx('A');
FileSys_SetParamEx('A', FST_PARM_UPDATE_FSINFO , TRUE); FileSys_SetParamEx('A', FST_PARM_UPDATE_FSINFO , TRUE);
#if HUNTING_CAMERA_MCU == ENABLE
if(TRUE == sf_check_card_full())
{
printf("ERR card full\r\n");
}
#endif
fastboot_set_done(BOOT_INIT_FILESYSOK); fastboot_set_done(BOOT_INIT_FILESYSOK);
printf("filesys_init e\r\n"); printf("filesys_init e\r\n");
} }

View File

@ -871,7 +871,11 @@ static void MovieFast_WriteFile_Task(void* arg)
MOVIEFAST_WRITE_QUEUE_PARAM* param; MOVIEFAST_WRITE_QUEUE_PARAM* param;
fastboot_wait_done(BOOT_INIT_FILESYSOK); fastboot_wait_done(BOOT_INIT_FILESYSOK);
if(TRUE == sf_is_card_full())
{
DBG_ERR("ERR card full\r\n");
return ;
}
while(1) while(1)
{ {
param = (MOVIEFAST_WRITE_QUEUE_PARAM*) lfqueue_deq(queue); param = (MOVIEFAST_WRITE_QUEUE_PARAM*) lfqueue_deq(queue);

View File

@ -890,6 +890,13 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId,
//sprintf(tmp, "W%03ld%04ld.JPG", nextFolderID, nextFileID); //sprintf(tmp, "W%03ld%04ld.JPG", nextFolderID, nextFileID);
strncpy(g_photo_fast_write_file_Path, tmp, sizeof(g_photo_fast_write_file_Path) - 1); 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); DBG_IND("last send file:%s\r\n", tmp);
if(TRUE == sf_is_card_full())
{
DBG_ERR("ERR Addr=0x%x,Size=0x%x,Fmt=%d card full\r\n", Addr, Size, Fmt);
rt =FST_STA_ERROR;
return rt;
}
#else #else
strncpy(g_photo_fast_write_file_Path, FilePath, sizeof(g_photo_fast_write_file_Path) - 1); strncpy(g_photo_fast_write_file_Path, FilePath, sizeof(g_photo_fast_write_file_Path) - 1);
#endif #endif
@ -1799,7 +1806,7 @@ exit:
#if SF_TRIGGER_TIME_TEST == ENABLE #if SF_TRIGGER_TIME_TEST == ENABLE
sf_trigger_time_led_cb(0); sf_trigger_time_led_cb(0);
#endif #endif
if(sf_get_power_off_flag()) if((sf_get_power_off_flag()) || (TRUE == sf_is_card_full()))
{ {
vos_flag_set(PHOTOFAST_FLG_ID, FLGPHOTOFAST_SHUTDOWN); vos_flag_set(PHOTOFAST_FLG_ID, FLGPHOTOFAST_SHUTDOWN);
} }

View File

@ -2371,13 +2371,13 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
DBG_IND("PHOTO THUMB %s\n", tmp); DBG_IND("PHOTO THUMB %s\n", tmp);
vos_perf_mark(&t3); vos_perf_mark(&t3);
if(FALSE == sf_is_card_full())
{
FST_FILE fp = FileSys_OpenFile(tmp, FST_CREATE_ALWAYS | FST_OPEN_WRITE); FST_FILE fp = FileSys_OpenFile(tmp, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
FileSys_WriteFile(fp, (UINT8*)queue_ele_in->jpg_thumb_addr, &queue_ele_in->jpg_thumb_size, 0, NULL); FileSys_WriteFile(fp, (UINT8*)queue_ele_in->jpg_thumb_addr, &queue_ele_in->jpg_thumb_size, 0, NULL);
FileSys_FlushFile(fp); FileSys_FlushFile(fp);
FileSys_CloseFile(fp); FileSys_CloseFile(fp);
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
memset(tmp, '\0', sizeof(tmp)); memset(tmp, '\0', sizeof(tmp));
snprintf(tmp, sizeof(tmp), "%s/%s", SF_SEND_LIST_DIR, file_path); /* DCF 8.3 naming rule */ snprintf(tmp, sizeof(tmp), "%s/%s", SF_SEND_LIST_DIR, file_path); /* DCF 8.3 naming rule */
@ -2386,6 +2386,8 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
DBG_IND("PHOTO THUMB %s \n %s\n %s\n", tmp, tmp2,file_path); DBG_IND("PHOTO THUMB %s \n %s\n %s\n", tmp, tmp2,file_path);
DBG_IND("%s:%d thumbfileSize:%d thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,queue_ele_in->jpg_thumb_size,tmp2,tmp); DBG_IND("%s:%d thumbfileSize:%d thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,queue_ele_in->jpg_thumb_size,tmp2,tmp);
#endif #endif
}
} }
vos_perf_mark(&t4); vos_perf_mark(&t4);

View File

@ -55,25 +55,25 @@ BOOL sf_is_card_full(void)
} }
UINT32 sf_check_card_full(void) UINT32 sf_check_card_full(void)
{ {
UINT64 diskFree = 0; int diskFree = 0;
UINT32 ret = 0; UINT32 ret = 0;
UIMenuStoreInfo *puiPara = sf_ui_para_get(); //UIMenuStoreInfo *puiPara = sf_ui_para_get();
if(!sf_in_card_exist()) if(!sf_in_card_exist())
{ {
return 1; return 1;
} }
/*check disk free size*/ /*check disk free size*/
diskFree = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE); diskFree = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
diskFree = diskFree/1024; diskFree = diskFree/1024/1024;
if(diskFree < 30) /* 30MB */ if(diskFree < 30) /* 30MB */
{ {
ret = TRUE; ret = TRUE;
if(0 == puiPara->SdLoopSwitch) //if(0 == puiPara->SdLoopSwitch)
{ {
IsCardFull = TRUE; IsCardFull = TRUE;
} }
@ -84,7 +84,8 @@ UINT32 sf_check_card_full(void)
ret = FALSE; ret = FALSE;
//printf("%s:%d sd card no full diskFree=%lu",__FUNCTION__,__LINE__,diskFree); //printf("%s:%d sd card no full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
} }
//printf("%s:%d sd card diskFree(%lu)",__FUNCTION__,__LINE__,diskFree);
//printf("[%s:%d]sd card diskFree=%dM\n", __FUNCTION__, __LINE__, diskFree);
return ret; return ret;
} }