1.30M剩余判断处理
This commit is contained in:
parent
49c47f0edc
commit
53bf5442ed
|
@ -12,6 +12,9 @@
|
|||
#include "sys_fastboot.h"
|
||||
#include "PrjCfg.h"
|
||||
#include "DxHunting.h"
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
#include <sf_mcu.h>
|
||||
#endif
|
||||
#if (HUNTING_CAMERA_MODEL == ENABLE)
|
||||
|
||||
#include "IOCfg.h"
|
||||
|
@ -56,6 +59,13 @@ static void card_insert_job(void)
|
|||
// call the function to wait init finish
|
||||
FileSys_WaitFinishEx('A');
|
||||
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);
|
||||
printf("filesys_init e\r\n");
|
||||
}
|
||||
|
|
|
@ -871,7 +871,11 @@ static void MovieFast_WriteFile_Task(void* arg)
|
|||
MOVIEFAST_WRITE_QUEUE_PARAM* param;
|
||||
|
||||
fastboot_wait_done(BOOT_INIT_FILESYSOK);
|
||||
|
||||
if(TRUE == sf_is_card_full())
|
||||
{
|
||||
DBG_ERR("ERR card full\r\n");
|
||||
return ;
|
||||
}
|
||||
while(1)
|
||||
{
|
||||
param = (MOVIEFAST_WRITE_QUEUE_PARAM*) lfqueue_deq(queue);
|
||||
|
|
|
@ -890,6 +890,13 @@ 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())
|
||||
{
|
||||
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
|
||||
strncpy(g_photo_fast_write_file_Path, FilePath, sizeof(g_photo_fast_write_file_Path) - 1);
|
||||
#endif
|
||||
|
@ -1799,7 +1806,7 @@ exit:
|
|||
#if SF_TRIGGER_TIME_TEST == ENABLE
|
||||
sf_trigger_time_led_cb(0);
|
||||
#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);
|
||||
}
|
||||
|
|
|
@ -2371,21 +2371,23 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
|
|||
DBG_IND("PHOTO THUMB %s\n", tmp);
|
||||
|
||||
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_FlushFile(fp);
|
||||
FileSys_CloseFile(fp);
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
memset(tmp, '\0', sizeof(tmp));
|
||||
snprintf(tmp, sizeof(tmp), "%s/%s", SF_SEND_LIST_DIR, file_path); /* DCF 8.3 naming rule */
|
||||
snprintf(tmp2, sizeof(tmp2), "%s", file_path); /* DCF 8.3 naming rule */
|
||||
sf_file_thumb_cfg_fill(tmp, tmp2, queue_ele_in->jpg_thumb_size, SF_FILE_TYPE_PIC_SMALL);
|
||||
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);
|
||||
#endif
|
||||
}
|
||||
|
||||
FileSys_WriteFile(fp, (UINT8*)queue_ele_in->jpg_thumb_addr, &queue_ele_in->jpg_thumb_size, 0, NULL);
|
||||
FileSys_FlushFile(fp);
|
||||
FileSys_CloseFile(fp);
|
||||
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
memset(tmp, '\0', sizeof(tmp));
|
||||
snprintf(tmp, sizeof(tmp), "%s/%s", SF_SEND_LIST_DIR, file_path); /* DCF 8.3 naming rule */
|
||||
snprintf(tmp2, sizeof(tmp2), "%s", file_path); /* DCF 8.3 naming rule */
|
||||
sf_file_thumb_cfg_fill(tmp, tmp2, queue_ele_in->jpg_thumb_size, SF_FILE_TYPE_PIC_SMALL);
|
||||
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);
|
||||
#endif
|
||||
}
|
||||
|
||||
vos_perf_mark(&t4);
|
||||
|
|
|
@ -55,38 +55,39 @@ BOOL sf_is_card_full(void)
|
|||
|
||||
}
|
||||
|
||||
|
||||
UINT32 sf_check_card_full(void)
|
||||
{
|
||||
UINT64 diskFree = 0;
|
||||
UINT32 ret = 0;
|
||||
|
||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||
int diskFree = 0;
|
||||
UINT32 ret = 0;
|
||||
|
||||
//UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||
if(!sf_in_card_exist())
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
/*check disk free size*/
|
||||
diskFree = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
|
||||
diskFree = diskFree/1024;
|
||||
|
||||
if(diskFree < 30) /* 30MB */
|
||||
{
|
||||
ret = TRUE;
|
||||
if(0 == puiPara->SdLoopSwitch)
|
||||
{
|
||||
IsCardFull = TRUE;
|
||||
}
|
||||
//printf("%s:%d sd card is full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = FALSE;
|
||||
//printf("%s:%d sd card no full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
|
||||
}
|
||||
//printf("%s:%d sd card diskFree(%lu)",__FUNCTION__,__LINE__,diskFree);
|
||||
|
||||
return ret;
|
||||
/*check disk free size*/
|
||||
diskFree = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
|
||||
diskFree = diskFree/1024/1024;
|
||||
|
||||
if(diskFree < 30) /* 30MB */
|
||||
{
|
||||
ret = TRUE;
|
||||
//if(0 == puiPara->SdLoopSwitch)
|
||||
{
|
||||
IsCardFull = TRUE;
|
||||
}
|
||||
//printf("%s:%d sd card is full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = FALSE;
|
||||
//printf("%s:%d sd card no full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
|
||||
}
|
||||
|
||||
//printf("[%s:%d]sd card diskFree=%dM\n", __FUNCTION__, __LINE__, diskFree);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void sf_sd_exist_reg_cb(SF_CALLBACK_SD_CMD fpCB)
|
||||
|
|
Loading…
Reference in New Issue
Block a user