1.修复无SD卡卡住问题
This commit is contained in:
parent
7b4e3fed49
commit
1956c8aef5
|
@ -62,6 +62,7 @@
|
||||||
#include <sf_mcu.h>
|
#include <sf_mcu.h>
|
||||||
#include "sf_led.h"
|
#include "sf_led.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "IOCfg.h"
|
||||||
#include <kwrap/cmdsys.h>
|
#include <kwrap/cmdsys.h>
|
||||||
/**
|
/**
|
||||||
Flags for control
|
Flags for control
|
||||||
|
@ -940,11 +941,13 @@ 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 HUNTING_CAMERA_MCU == ENABLE
|
||||||
if(TRUE == sf_is_card_full())
|
if(TRUE == sf_is_card_full())
|
||||||
{
|
{
|
||||||
DBG_ERR("ERR card full\r\n");
|
DBG_ERR("ERR card full\r\n");
|
||||||
return ;
|
//return ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
param = (MOVIEFAST_WRITE_QUEUE_PARAM*) lfqueue_deq(queue);
|
param = (MOVIEFAST_WRITE_QUEUE_PARAM*) lfqueue_deq(queue);
|
||||||
|
@ -955,20 +958,27 @@ static void MovieFast_WriteFile_Task(void* arg)
|
||||||
|
|
||||||
if(param->va){
|
if(param->va){
|
||||||
DBG_DUMP("Write %s\n", param->path);
|
DBG_DUMP("Write %s\n", param->path);
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
FST_FILE fp = FileSys_OpenFile(param->path, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
if(TRUE != sf_is_card_full())
|
||||||
FileSys_WriteFile(fp, (UINT8*)param->va, ¶m->size, 0, NULL);
|
#endif
|
||||||
FileSys_CloseFile(fp);
|
{
|
||||||
|
FST_FILE fp = FileSys_OpenFile(param->path, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
||||||
|
FileSys_WriteFile(fp, (UINT8*)param->va, ¶m->size, 0, NULL);
|
||||||
|
FileSys_CloseFile(fp);
|
||||||
|
}
|
||||||
|
|
||||||
free(param->va);
|
free(param->va);
|
||||||
}
|
}
|
||||||
else if(param->frame.phy_addr[0]){
|
else if(param->frame.phy_addr[0]){
|
||||||
DBG_DUMP("Write %s\n", param->path);
|
DBG_DUMP("Write %s\n", param->path);
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
FST_FILE fp = FileSys_OpenFile(param->path, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
if(TRUE != sf_is_card_full())
|
||||||
FileSys_WriteFile(fp, (UINT8*)param->frame.phy_addr[0], ¶m->size, 0, NULL);
|
#endif
|
||||||
FileSys_CloseFile(fp);
|
{
|
||||||
|
FST_FILE fp = FileSys_OpenFile(param->path, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
||||||
|
FileSys_WriteFile(fp, (UINT8*)param->frame.phy_addr[0], ¶m->size, 0, NULL);
|
||||||
|
FileSys_CloseFile(fp);
|
||||||
|
}
|
||||||
hd_videoproc_release_out_buf(param->vprc_path_id, ¶m->frame);
|
hd_videoproc_release_out_buf(param->vprc_path_id, ¶m->frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1135,8 +1145,12 @@ THREAD_RETTYPE MovieFast_InitFileNamingThread(void *arg)
|
||||||
DCF_SetDirFreeChars(DCF_DIR_NAME);
|
DCF_SetDirFreeChars(DCF_DIR_NAME);
|
||||||
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME);
|
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME);
|
||||||
DCF_ScanObj();
|
DCF_ScanObj();
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
fastboot_set_done(BOOT_INIT_FILENAMINGOK);
|
if(TRUE != sf_is_card_full())
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
fastboot_set_done(BOOT_INIT_FILENAMINGOK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EXIT:
|
EXIT:
|
||||||
|
@ -1282,6 +1296,11 @@ static INT32 MovieFast_Mode2_Get_Cont_Shot(UINT32* max_cnt, UINT32* duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
if(FALSE == (gpio_getPin(GPIO_CARD_DETECT) == 0 ? TRUE : FALSE))
|
||||||
|
{
|
||||||
|
*max_cnt = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if(SF_MULTISHOT_INTEVEL_1S == puiPara->MultiShotIntevel)
|
if(SF_MULTISHOT_INTEVEL_1S == puiPara->MultiShotIntevel)
|
||||||
{
|
{
|
||||||
*duration = 1000;//The interval between consecutive shots of each photo is 1 second
|
*duration = 1000;//The interval between consecutive shots of each photo is 1 second
|
||||||
|
@ -1798,7 +1817,7 @@ static void MovieFast_Close(void)
|
||||||
{
|
{
|
||||||
if(PhotoFast_Sliceencode2_Enq_Frame(&frame) == E_OK){
|
if(PhotoFast_Sliceencode2_Enq_Frame(&frame) == E_OK){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
vos_util_delay_ms(1);
|
vos_util_delay_ms(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user