From 005e3429c29e583e2ac95905aaf149a0eec6a07c Mon Sep 17 00:00:00 2001 From: "sober.song" Date: Thu, 4 Jan 2024 15:26:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9camera.info=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=B8=BA=E5=8A=A8=E6=80=81=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/include/sf_systemMng.h | 2 +- .../sf_app/code/source/systemMng/sf_systemMng.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/code/application/source/sf_app/code/include/sf_systemMng.h b/code/application/source/sf_app/code/include/sf_systemMng.h index 06d91321c..b47282ebe 100644 --- a/code/application/source/sf_app/code/include/sf_systemMng.h +++ b/code/application/source/sf_app/code/include/sf_systemMng.h @@ -17,7 +17,7 @@ extern "C" { // following define must be same to "kernel\drivers\sstar\include\mdrv_msys_io.h" -#define SF_VER_FILE_PATH SF_SD_ROOT"CAM_INFO.txt" +#define SF_VER_FILE_PATH "CAM_INFO.txt" typedef enum sfUPGRADE_STATUS_E { diff --git a/code/application/source/sf_app/code/source/systemMng/sf_systemMng.c b/code/application/source/sf_app/code/source/systemMng/sf_systemMng.c index 58ff8a309..078cd184d 100644 --- a/code/application/source/sf_app/code/source/systemMng/sf_systemMng.c +++ b/code/application/source/sf_app/code/source/systemMng/sf_systemMng.c @@ -281,11 +281,20 @@ SINT32 sf_sys_software_version_get(SF_CHAR* version) SINT32 sf_sys_camera_about(void) { SF_CHAR Temp[128] = {0}; + + char *file_path = sf_root_path_strcat(SF_VER_FILE_PATH); + if(file_path == NULL) + { + free(file_path); + return SF_FAILURE; + } + SF_PDT_PARAM_STATISTICS_S *pstaticparam = sf_statistics_param_get(); FILE *fp; - if((fp =fopen(SF_VER_FILE_PATH,"w+")) == NULL) + if((fp =fopen(file_path,"w+")) == NULL) { - MLOGE("open [%s] failed!!!\n",SF_VER_FILE_PATH); + MLOGE("open [%s] failed!!!\n",file_path); + free(file_path); return SF_FAILURE; } memset(Temp,'\0',sizeof(Temp)/sizeof(char)); @@ -321,7 +330,7 @@ SINT32 sf_sys_camera_about(void) fwrite(Temp,sizeof(char), strlen(Temp),fp); fflush(fp); fclose(fp); - + free(file_path); return SUCCESS; }