修复linux系统启动首次命名盘符错乱问题

This commit is contained in:
sober.song 2024-01-06 18:36:22 +08:00
parent 642167b25e
commit 9b6fa552e6
3 changed files with 18 additions and 5 deletions

View File

@ -19,6 +19,10 @@
#include <sf_param_struct.h>
#include <FileSysTsk.h>
#include "sf_mcu.h"
#if (USE_DCF == ENABLE)
#include "DCF.h"
#endif
#if HUNTING_CAMERA_MCU == ENABLE
#include <sf_message_queue.h>
@ -336,6 +340,12 @@ SF_ST_MMC_DEV *SF_StrgCheckWorkableDev(void)
sf_mmc_dev[workable_dev]->dev_type = workable_dev;
//MLOGD("Strg Check, workable_dev = %d\n", workable_dev);
SF_SetMMCDev(sf_mmc_dev[workable_dev]);
if(workable_dev == MMC_DEV_SD)
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYEX");
else if(workable_dev == MMC_DEV_EMMC)
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYBX");
return sf_mmc_dev[workable_dev];
}
}

View File

@ -983,11 +983,11 @@ INT32 System_OnStrgInsert(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
if(strg_id == STRG_ID_SD){
DBG_WRN("sd act\n");
System_Set_Storage_Act_Drive(g_strg_mapping_table[strg_id].drive);
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYEX");
//DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYEX");
}
else if(strg_id == STRG_ID_EMMC){
DBG_WRN("emmc act\n");
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYBX");
//DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYBX");
System_Set_Storage_Act_Drive(g_strg_mapping_table[strg_id].drive);
}
#if USE_MMC_DEV_CHECK

View File

@ -1227,6 +1227,8 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName)
UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */
char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'E';
char *dcf_file = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? "SYBX" : "SYEX";
DBG_DUMP("movie naming: %c %s\n", System_Get_DCF_Disk_Drive(dcf_handle), dcf_file);
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file);
#if USE_FILEDB
static struct tm CurDateTime = {0};
g_FileSerialNum++;
@ -1265,7 +1267,6 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName)
pFileName[0] = '\0';
} else {
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file);
DCF_GetNextIDEx(dcf_handle, &nextFolderID,&nextFileID);
DCF_MakeObjPathEx(dcf_handle, nextFolderID, nextFileID, DCF_FILE_TYPE_MP4, pFileName);
DCF_AddDBfileEx(dcf_handle, pFileName);
@ -1301,6 +1302,8 @@ static void MovieExe_RawEncodeFileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName)
{
UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */
char *dcf_file = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? "SYBX" : "SYEX";
DBG_DUMP("photo naming: %c %s\n", System_Get_DCF_Disk_Drive(dcf_handle), dcf_file);
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file);
#if USE_FILEDB
static struct tm CurDateTime = {0};
@ -1339,7 +1342,7 @@ static void MovieExe_RawEncodeFileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName)
pFileName[0] = '\0';
} else {
DBG_DUMP("JPG %s added to DCF Path%lu\r\n", pFileName, dcf_handle);
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file);
DCF_GetNextIDEx(dcf_handle, &nextFolderID,&nextFileID);
DCF_MakeObjPathEx(dcf_handle, nextFolderID, nextFileID, DCF_FILE_TYPE_JPG, pFileName);
}