From 258fb65dd37a78c32c94210171813a925420c6a4 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 15 Sep 2023 18:08:26 +0800 Subject: [PATCH] =?UTF-8?q?1.dbg=E5=BC=80=E5=85=B3=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/cardv/SrcCode/System/SysStrg_Exe.c | 29 ++++++++- .../UIApp/Background/UIBackgroundObj.c | 62 +++++++++++++++++-- .../source/cardv/SrcCode/System/SysStrg_Exe.c | 31 +++++++++- .../UIApp/Background/UIBackgroundObj.c | 58 ++++++++++++++++- 4 files changed, 170 insertions(+), 10 deletions(-) diff --git a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index da53127fa..2c87e66f0 100644 --- a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -517,7 +517,16 @@ void System_OnStrgExit_FS(void) { //PHASE-2 : Close Lib or LibExt #if (LOGFILE_FUNC==ENABLE) - LogFile_Close(); + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if (puiPara->DebugMode) + { + LogFile_Close(); + } + #else + LogFile_Close(); + #endif + #endif // unmount file system GxStrg_CloseDevice(0); @@ -734,8 +743,18 @@ INT32 System_OnStrgRemove(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) if (m_BootState_Drive[stg_id] != BOOT_CARD_STATE_UNKNOWN) { if (stg_id == 0) { #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if (puiPara->DebugMode) + { + LogFile_Suspend(); + LogFile_Close(); + } + #else LogFile_Suspend(); LogFile_Close(); + #endif + #endif #if (USERLOG_FUNC == ENABLE) { @@ -908,7 +927,13 @@ INT32 System_OnStrgAttach(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) #endif #if (LOGFILE_FUNC==ENABLE) - if (SxTimer_GetFuncActive(SX_TIMER_DET_SYSTEM_ERROR_ID) == 0) + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + + if ((puiPara->DebugMode) && SxTimer_GetFuncActive(SX_TIMER_DET_SYSTEM_ERROR_ID) == 0) + #else + if (SxTimer_GetFuncActive(SX_TIMER_DET_SYSTEM_ERROR_ID) == 0) + #endif { LOGFILE_OPEN logOpenParm = {0}; UINT32 maxFileNum = 32; diff --git a/code/application/source/cardv/SrcCode/UIApp/Background/UIBackgroundObj.c b/code/application/source/cardv/SrcCode/UIApp/Background/UIBackgroundObj.c index 6742b6a50..31e25200a 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Background/UIBackgroundObj.c +++ b/code/application/source/cardv/SrcCode/UIApp/Background/UIBackgroundObj.c @@ -787,8 +787,18 @@ UINT32 BackgroundFormat(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if (puiPara->DebugMode) + { + LogFile_Suspend(); + LogFile_Complete(); + } + #else LogFile_Suspend(); LogFile_Complete(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end ret = FileSys_FormatDisk(pStrgDXH, FALSE); @@ -816,7 +826,15 @@ UINT32 BackgroundFormat(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + if (puiPara->DebugMode) + { + LogFile_ReOpen(); + } + #else LogFile_ReOpen(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end } @@ -846,8 +864,19 @@ UINT32 BackgroundFormatCard(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) - LogFile_Suspend(); - LogFile_Complete(); + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if (puiPara->DebugMode) + { + LogFile_Suspend(); + LogFile_Complete(); + } + #else + LogFile_Suspend(); + LogFile_Complete(); + #endif + + #endif //#NT#2016/05/30#Lincy Lin -end ret = FileSys_FormatDisk(pStrgDXH, FALSE); @@ -875,7 +904,15 @@ UINT32 BackgroundFormatCard(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + if (puiPara->DebugMode) + { + LogFile_ReOpen(); + } + #else LogFile_ReOpen(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end vos_util_delay_ms(1000); @@ -920,8 +957,18 @@ UINT32 BackgroundFormatNand(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) - LogFile_Suspend(); - LogFile_Complete(); + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if (puiPara->DebugMode) + { + LogFile_Suspend(); + LogFile_Complete(); + } + #else + LogFile_Suspend(); + LogFile_Complete(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end ret = FileSys_FormatDisk(pStrgDXH, FALSE); @@ -949,7 +996,14 @@ UINT32 BackgroundFormatNand(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + if (puiPara->DebugMode) + { LogFile_ReOpen(); + } + #else + LogFile_ReOpen(); + #endif #endif //#NT#2016/05/30#Lincy Lin -end } diff --git a/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index 196706b89..e96ff6893 100644 --- a/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -484,7 +484,15 @@ void System_OnStrgExit_FS(void) { //PHASE-2 : Close Lib or LibExt #if (LOGFILE_FUNC==ENABLE) - LogFile_Close(); + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if(puiPara->DebugMode) + { + LogFile_Close(); + } + #else + LogFile_Close(); + #endif #endif // unmount file system GxStrg_CloseDevice(0); @@ -628,8 +636,19 @@ INT32 System_OnStrgRemove(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) if (m_BootState_Drive[stg_id] != BOOT_CARD_STATE_UNKNOWN) { if (stg_id == 0) { #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if(puiPara->DebugMode) + { LogFile_Suspend(); LogFile_Close(); + } + #else + LogFile_Suspend(); + LogFile_Close(); + #endif + + #endif #if (USERLOG_FUNC == ENABLE) { @@ -762,7 +781,14 @@ INT32 System_OnStrgAttach(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) } } #if (LOGFILE_FUNC==ENABLE) - if (SxTimer_GetFuncActive(SX_TIMER_DET_SYSTEM_ERROR_ID) == 0) + + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + + if ((puiPara->DebugMode) && SxTimer_GetFuncActive(SX_TIMER_DET_SYSTEM_ERROR_ID) == 0) + #else + if (SxTimer_GetFuncActive(SX_TIMER_DET_SYSTEM_ERROR_ID) == 0) + #endif { LOGFILE_OPEN logOpenParm = {0}; UINT32 maxFileNum = 32; @@ -779,6 +805,7 @@ INT32 System_OnStrgAttach(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) logOpenParm.isSaveLastTimeSysErrLog = wdt_getResetNum()>0 ? TRUE : FALSE; logOpenParm.lastTimeSysErrLogBuffAddr = mempool_logfile; logOpenParm.lastTimeSysErrLogBuffSize = POOL_SIZE_LOGFILE; + logOpenParm.isZeroFile = TRUE; strncpy(logOpenParm.rootDir, rootDir, LOGFILE_ROOT_DIR_MAX_LEN); #if defined(_CPU2_LINUX_) strncpy(logOpenParm.rootDir2, rootDir2, LOGFILE_ROOT_DIR_MAX_LEN); diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/Background/UIBackgroundObj.c b/rtos/code/application/source/cardv/SrcCode/UIApp/Background/UIBackgroundObj.c index 13f8cc943..0ecec41dc 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/Background/UIBackgroundObj.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/Background/UIBackgroundObj.c @@ -748,8 +748,18 @@ UINT32 BackgroundFormat(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) - LogFile_Suspend(); - LogFile_Complete(); + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if(puiPara->DebugMode) + { + LogFile_Suspend(); + LogFile_Close(); + } + #else + LogFile_Suspend(); + LogFile_Close(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end ret = FileSys_FormatDisk(pStrgDXH, FALSE); @@ -777,7 +787,14 @@ UINT32 BackgroundFormat(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + if(puiPara->DebugMode) + { LogFile_ReOpen(); + } + #else + LogFile_ReOpen(); + #endif #endif //#NT#2016/05/30#Lincy Lin -end } @@ -807,8 +824,18 @@ UINT32 BackgroundFormatCard(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if(puiPara->DebugMode) + { + LogFile_Suspend(); + LogFile_Complete(); + } + #else LogFile_Suspend(); LogFile_Complete(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end ret = FileSys_FormatDisk(pStrgDXH, FALSE); @@ -836,7 +863,15 @@ UINT32 BackgroundFormatCard(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + if(puiPara->DebugMode) + { LogFile_ReOpen(); + } + #else + LogFile_ReOpen(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end } @@ -856,8 +891,19 @@ UINT32 BackgroundFormatNand(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + + #if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if(puiPara->DebugMode) + { + LogFile_Suspend(); + LogFile_Complete(); + } + #else LogFile_Suspend(); LogFile_Complete(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end ret = FileSys_FormatDisk(pStrgDXH, FALSE); @@ -885,7 +931,15 @@ UINT32 BackgroundFormatNand(void) //#NT#2016/05/30#Lincy Lin -begin //#NT#Support logfile function #if (LOGFILE_FUNC==ENABLE) + #if HUNTING_CAMERA_MCU == ENABLE + if(puiPara->DebugMode) + { LogFile_ReOpen(); + } + #else + LogFile_ReOpen(); + #endif + #endif //#NT#2016/05/30#Lincy Lin -end }